If one form is calling the other (or form/subform) then you can pass it via a function on the called form. If the forms are run separately then you could pass the variable via a single-instance codeunit.
In my case, I access the FORM02 by a lookup on field situated on the FORM01. The goal is to do treatment based on the value of the variable I could pass from the FORM01.
What is a single-instance codeunit ?
No need to user single instance codeunit (it use for hold value until the application or process running ) you need to make a function in lookup form and then pass value to this form.
I have a FORM01 and a FORM02. I need to pass a variable from FORM01 to FORM02. How can I do that ?
An idea ?
Dear LeoNav,
maybe you should consider reading some basic documentation on programming NAV before laying hands on it. Read and use the Application Designers Guide included in each NAV installation CD/DVD, NAV online help and countless docs on the web.
I don't understand how a function can help me to remember a value from the FORM01 and pass it to the other FORM02. In my case I want to do this on the FORM01 :
1)Rec.Field
2) store that value in a variable X
3) reuse the value of the variable X in the FORM02
Maybe I'm not very clear. Below is a picture of the 2 forms that I use.
I want to select multiple records from the form on the right. In order to do it, I use the code at the bottom of the screen. Each FORM is linked to a different table. The one on the left is linked to the table 56204 (primary key : Qualification code, Code, Name). The one on the right is linked to the table Job (167).
I would like the system to put the records of the multiple selection (on the right side) in the form on the left side. But how does the system know what Qualification code to use to insert the records in the table 56204 ?
For the moment, I give a static value to it for testing but how can I retrieve the Qualification code selected on the left side and pass it to the right ?
Create a new field that will be used to flag the lines. For an example look at Apply Payments in the Customer or Vendor Ledgers.
Really though you need to understand the business requirement before you start writing even one line of code and even then you need to learn Navision before you write code. If you understood the basic Navision functionality, this would be second nature to you.
Answers
What is a single-instance codeunit ?
Thanks.
Dear LeoNav,
maybe you should consider reading some basic documentation on programming NAV before laying hands on it. Read and use the Application Designers Guide included in each NAV installation CD/DVD, NAV online help and countless docs on the web.
1)Rec.Field
2) store that value in a variable X
3) reuse the value of the variable X in the FORM02
This post seems to be the extension of
http://mibuso.com/forum/viewtopic.php?f=23&t=45060
http://ssdynamics.co.in
In FORM1 you have a variable FORM2 of type Form and subtype MyForm and a global variable X of some type;
In FORM2 you have a global variable X of some type.
In MyForm create a function fnSetX that takes the new value of X as a parameter lets call the parameter newValue.
In fnSetX simply do X:=newValue;
In FORM1 call the function i FORM2 like this:
FRORM2.fnSetX(X)
Now the variable X in FORM2 will have the same value as the variable X in FORM1.
Thanks.
I want to select multiple records from the form on the right. In order to do it, I use the code at the bottom of the screen. Each FORM is linked to a different table. The one on the left is linked to the table 56204 (primary key : Qualification code, Code, Name). The one on the right is linked to the table Job (167).
I would like the system to put the records of the multiple selection (on the right side) in the form on the left side. But how does the system know what Qualification code to use to insert the records in the table 56204 ?
For the moment, I give a static value to it for testing but how can I retrieve the Qualification code selected on the left side and pass it to the right ?
Really though you need to understand the business requirement before you start writing even one line of code and even then you need to learn Navision before you write code. If you understood the basic Navision functionality, this would be second nature to you.