AL icon indicating copy to clipboard operation
AL copied to clipboard

Use the Value of a Variable on a Page - Leaving no Footprints

Open ashishsharmanav opened this issue 8 years ago • 2 comments

How can i use the value of a variable on a page by creating a subscriber event of the trigger OnAfterValidateEvent of the page.

Ex : Page 39 - General Journal - Variable CurrentJnlBatchName - If i would want to put some validation based on the variable value of the CurrentJnlBatchName, then i can subscribe EventPublisherObject - Page General Journal using EventFunction as OnAfterValidateEvent and EventPublisherElement - CurrentJnlBatchName. Wherein i can use Values in Rec and xRec, However i cannot use the value in variable CurrentJnlBatchName to make any Validation.

Is there a workaround or this need to be fixed?

ashishsharmanav avatar Jul 08 '18 07:07 ashishsharmanav

Hi @ashishsharmanav, if you want to use the value of a variable on a page then you should try to use an Integration Event as this is the only type of events that would allow you to access variables. You can read more about events in AL here: Events in AL.

qutreson avatar Jul 09 '18 08:07 qutreson

Hi @qutreson - Thanks for the Reply. Actually that's what i did. I raised the Event on the Page and Published the Event on the related Table (which i have to raise as an Issue for new event-request creation), was just wondering if this can be achieved using Trigger Events considering that in this case we actually know what action has been triggered.

ashishsharmanav avatar Jul 09 '18 08:07 ashishsharmanav