How to get selected Sales Line No.

upasanisandipupasanisandip Member Posts: 405
Dear all,
I have a command button on Sales Order Form. Now I want the selected SalesLine."Line No.". When I click on command button on Sales Order Form it is giving me value 0.

Because of command button is on main form & sales line table is on subform. How to resoved this prob?


thanks,
sandip.

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    Define a name for the subform.
    Define a function on subform.
    put MESSAGE(FORMAT("Line No.")) in the new function on the subform.

    Under button call the function in the subform: CurrForm.SubformName.FORM.FunctionNameSubform;

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • upasanisandipupasanisandip Member Posts: 405
    Thanks tinoruijs,
    Your solution is perfect but I was finding solution without touching any standard code. I have tried to find out from standard codeunits where I will get salesline."line no." but not possible to get it.
  • awarnawarn Member Posts: 261
    Well, isnt putting a new button on the sales form not standard code?

    -a
  • DenSterDenSter Member Posts: 8,305
    Thanks tinoruijs,
    Your solution is perfect but I was finding solution without touching any standard code. I have tried to find out from standard codeunits where I will get salesline."line no." but not possible to get it.
    So you're asking a question, someone gives you an answer and tells you EXACTLY how to do something, and then you say 'no that is not the correct answer' :-k

    I don't understand that way of thinking...
  • garakgarak Member Posts: 3,263
    tzzzz

    Take a look behind the Button "Line" on Sales Order form. There are some standard functions and you can see, how you can get the selected Line.

    Some things are very simple ;-) And you will see, the standard is using the same solution like tinoruijs tip

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.