Before Command hook
Use this hook to perform additional actions before the form
command is executed. This hook can use actual values of the form fields. You
can cancel the execution of the command by calling the choice.again()
function.
If the standard hook must be executed before the extension hook is executed, you
can force the standard hook to execute anytime you prefer. This can be
achieved by calling the command.super()
function.
Example:
function extern function.approve.order.line.before.command()
{
command.super()
string l.mess(200) mb
|* Check approval against company rules
if not txpurdll0001.can.approve.line.with.mess(
tdpur401.orno, tdpur401.pono, l.mess) then
message(l.mess)
choice.again()
endif
}
Note: This is an alternative
for the
Is Enabled
hook as described
earlier. You can keep the command enabled and this hook gives a message that
a line cannot be approved.