Hey, I'm still learning this..
I defined a global variable in codeunit, assigned it a value in one function of that codeunit when launching a form, and in after validate trigger on that form i want to launch another function form that codeunit where i want to use value of my global variable, but its empty.
What's going on exactly? Only direct assignment operation on that variable is when I assign it a value in first function.
Regards.
0
Comments
set and get
Set()
Num := 1000;
Get()
MESSAGE('%1',Num);
Num is a global variable of type integer..
Created new form and called Set function onOpen form.
Added a text field and called Get function OnAftervalidate of that field
message showed 1000
I didnt have any problem..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
My Blog - nav.education
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Function executes after pressing button.
Codeunit.Function(GivenRec);
user selects record and then presses button.
It operates on gl entries.
Function goes like this:
table gl entry has additional field lests say AppID
if givenRec.Apply ID = ''
then CurrGLEntry SETRANGE(givenRec.EntryNo)
ELSE
currGLEntry.SETRANGE(givenRec.Apply ID)
//my global variable is AppID Code
AppID := givenRec.Apply ID;
I also tried to create another global variable TempEntry And Tempentry.TRANSFERFIELDS(CurrGLEntry);
to get Apply ID form it.
Then
FORM.RUNMODAL(Form,CurrGlEntry);
//
I checked in debugger, it sets correctly a value to AppID or TempEntry. But when i try to use these values they are empty.
Please help..
Function2()
IF AppID <> comparedWithSth THEN...
and here that value appears as empty
I declared codeunit in form as global variable, and trying to execute functions from codeunit. Then i have empty values. So You say to declare single instance codeunit? I heard its not safe.. Is that right?
Regards.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!