Find Current Item on Sales Order form

ALopez27ALopez27 Member Posts: 42
I'm fairly new to NAV, so here is my question:

I want to add functionality on the std. Sales Order form (42), but I need to find out how to tell in code the current sales order LINE, I want to add a menu item on one of the bottom buttons and display info. based on the current item, it seems simple enough, but can someone tell me, how to know which is the current sales order line record?? Thanks.

A.L.

Comments

  • DenSterDenSter Member Posts: 8,305
    Open form 42 in design, right click the "Line" menubutton, and take a look at the code behind that button. See how that relates to a function on the subform, and extrapolate a way to implement your requirement. Once you figure out how that works, it should be a piece of cake :mrgreen:
  • ALopez27ALopez27 Member Posts: 42
    I looked at the "Line" menubutton and it certainly helps, however, one of the lines in the menu has code that it calls similar to the below statement, I see there is a local function in the Sales Line table that is referenced by this (ItemAvailability), however, I'm not sure what the 'SalesLines' parameter after CurrForm is or means or where it's declared, can someone help me with this? Is this some type of control in the actual form? How or where do I see this? Thanks.

    CurrForm.SalesLines.FORM.ItemAvailability(0);

    A.L.
  • DenSterDenSter Member Posts: 8,305
    Open the form in runtime. Turn on the debugger. Execute the menu-item and step through the code. Check which object is open, see what the function does with the parameter value.
Sign In or Register to comment.