APP: How Do I Use OnClosePage Trigger?

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.



  1. Open Anveo Page in Anveo Client Suite Setup in your Microsoft Dynamics NAV
  2. Create a new Action Code (or modify your existing one) for your OnClosePage Action property in your Anveo Page.
  3. Define your condition via Anveo Script like
    if (Rec:GETVALUE('External Document No.') == '') then
       MESSAGE('External Document No. is empty.');
       PAGE('CLOSE', false);

    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.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request