It is simple to run a form (a list of orders), create a menu-button to open a second form with order lines (related to the OrderNo. from the first form). So, I’m not talking about a standard form and subform, but two separate forms.
But…
I know the Companyname in the first form, but I want to copy the Companyname to a global and place it on the second form in a Textfield. Is that possible and how can I do that?
0
Comments
This is the same solution as passing values to sub-forms - i.e. create a function in the second form which assigns the global value and call this function from the first form.
e.g.
Secondform.setglobal( par1,... );
where Secondform is declared as a form
Hope this helps
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html
Thanks. But I'm still not able to use the global-value in the form:
The function opens the orderline-form with the OrderNo-filter. If I want to select some lines to fill a textfield with the value of my global, the value remains empty, because it can only be used in the function.
This seems a different issue. The record filter is set before it will check the global variable. The solution for this is to create a record variable and filter this in the first form. Create the second form as a variable and use the command Secondform.settableview( Salesline ); You can still pass the variable as long as you are setting the variable to a gobal in the function of the second form.
Dynamics Nav Add-ons
http://www.simplydynamics.ie/Addons.html