Passing a Var to a Codeunit

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?

Answers

  • Developer101Developer101 Member Posts: 553
    You have mentioned you are running to a codeunit then mentioned , that you are running from an action. Please clarify what do you want to achieve
    United Kingdom
  • lubostlubost Member Posts: 628
    My preferred method:
    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>();
Sign In or Register to comment.