Options

Send Keys Problem when creating the Sales Order?

kishi_gkishi_g Member Posts: 162
Hi,
I was strucked by using Send keys. By using one form i will open sales order form and give the details automatically.

I wrote code below.

Form-OnTimer()

form.run(42);

wsript.SendKeys('{f3});

SO.Init;
SO."Document Type := SO."Document Type :: Order;
SO."No." := '1234';
SO."Sell-to-Customer" := '10000';
SO.Insert;

I gave the Item details manually.

after that
wsript.SendKeys('%o');
wsript.SendKeys('o');

but the order is not posted??? It will open the form but the Sales Order No.
is different. it will not go to that No. as 1234.


How can i post the Order???


Thanks & regards,
kishore...

Comments

  • Options
    matttraxmatttrax Member Posts: 2,309
    Just look at the code on the Post button. Use that code and pass the correct Sales Header to Codeunit 80. You don't need to do anything with send keys.
  • Options
    kinekine Member Posts: 12,562
    Exactly, your case is total misuse of the SendKey functionality... ll what you need you can do through correct code.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    rajpatelbcarajpatelbca Member Posts: 178
    here problem is that you will see only first record on the form.

    i am agree with matttrax. you have to pass your specified record in this syntax below.

    FORM.RUN(Number [, Record] [, Field])

    eg.
    FORM.RUN(42, your filtered record of sales header)
    Experience Makes Man Perfect....
    Rajesh Patel
  • Options
    kishi_gkishi_g Member Posts: 162
    Hi Guys,
    Thanks for ur replies. My doubt is by using the SendKeys i will post the order. because Iam new using these sendkeys. Thats what iam asking.
    How to post the Order through SendKeys??? Iam Practicing with SendKeys.



    Thanks & Reagards,
    kishore...
  • Options
    SavatageSavatage Member Posts: 7,142
    As stated above, this is the wrong use for send keys. You should "practice" using it somewhere else.
Sign In or Register to comment.