What This Article Is About
On an Anveo Mobile App page, you can define a trigger that is run before the Anveo Page is closed. It is called OnClosePage Trigger. You can define conditions using Anveo Script whether to allow to close the current Anveo Page or not.
Walkthrough
- Open Anveo Page in Anveo Client Suite Setup in your Microsoft Dynamics NAV
- Create a new Action Code (or modify your existing one) for your OnClosePage Action property in your Anveo Page.
- Define your condition via Anveo Script like
if (Rec:GETVALUE('External Document No.') == '') then
MESSAGE('External Document No. is empty.');
else
PAGE('CLOSE', false);
end;
Note: If you have defined an OnClosePage Action, it is required to run PAGE('CLOSE', false); somewhere in your code to close the Anveo Page.
If this is not called, you Page will not be closed.
Without an OnClosePage Action, your Anveo Page will be closed automatically when the user navigates back.
Do not call PAGE('CLOSE') or PAGE('CLOSE',true); in your OnClosePage Trigger. This would result in a loop because the trigger calls itself again.
Comments