I am trying to pass a page variable from the page onqueryclose to the codeunit. I am running the code unit from an action, in the codeunit I run
IF PAGE.RUNMODAL(50324,T50037) = ACTION::LookupOK THEN
MESSAGE('%1',SEapprovalCommentField);
Pretty much opens a page with an extra box to type in and I want to send whatever you type to the codeunit as a global to use. Message was just for testing. Not sure why but the var passes but the second the page closes the debugger shows the variable blank.
On validate and onqueryclose from the open page runs codeunit function to set the global for the codeunit.
SEApprovalComment(Comment : Text)
SEapprovalCommentField:=Comment;
Why is the var showing blank?
0
Answers
1. Add global function to page. Function should return data you want.
2. In codeunit define page variable with your page and call:
IF <Page variable>.RUNMODAL(T50037) = ACTION::LookupOK THEN
SEapprovalCommentField := <Page Variable>.<Point 1 function>();