EXIT is used to end the processing within an AL trigger. EXIT works the same, regardless of whether it is executed within a loop. It can be used to end the processing of the trigger or to pass a return value from a local function. A return value cannot be used for system-defined triggers or local functions that don't have a return value defined. If EXIT is used without a return value, a default return value of zero is returned.
The syntax for EXIT is as follows:
EXIT([<ReturnValue>])