Hi, i've added a new subform to the item card.
In this subform i have created the following method:
SetItemCode(ItemCode : Code[20])
gv_ItemCode := ItemCode;
This subform also contains a button with the following push action:
<Control1000000007> - OnPush()
MESSAGE('Item Code: ' + FORMAT(gv_ItemCode));
The gv_ItemCode is a global variable...
Then in Item Card form, in the onaftergetrecord i call the SetItemCode
and pass Rec."No." to it...
If i follow in debugger the gv_ItemCode gets filled up with the Rec."No."
When i then go to the tabpage with my new subform on and press the button, the gv_ItemCode is back empty ](*,)
Why is this?
0
Answers
gv_EenhedenSubForm.SetItemCode("No.");
gv_EenhedenSubForm is a global variable of type Form
Form - OnAfterGetRecord()
CurrForm.SubForm.FORM.SetItemNo("No.");
SubForm:
SetItemNo(LocItemNo : Code[20])
GlobItemNo := LocItemNo;
Button on Subform
<Control1119402007> - OnPush()
MESSAGE(GlobItemNo);
for more details for the GETRECORD function. Please read the help.
I want to have the Item rec inside my subform
I dont want to have the record from my subform inside the Item Card Form
This was what i needed... i was unable to call the function of my named subform cause i allways tried like CurrForm.SubForm.SetItemNo("No.")
which was not valid off course
I didnt know you had to add .FORM between it
Anyway, works fine now. Thanks for the help O:)
Please write [solved] infront of you subject (first post)
my subform name is :salelines,and I add a function example
example()
message('it is ok');
main form I add button I call it
currform.saleline.form.example;