SDU
Personal tools

Triggering Reaction

From SDU

Jump to: navigation, search
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This article shows how items passed through a trigger can be queried from the script.

Details

Lets assume we have already added a Site-Defined Trigger to call zMyScript and pass the Assignee value.

Example:
POST_VALIDATE zMyScript(assignee) 111 FILTER(EVENT("UPDATE"));
Lets focus only on the zMyScript(assignee) portion.

Three items of information regarding the assignee are passed from the trigger to the script.
[1] is the original state value before editing began.
[2] is the last known value when the trigger was initiated.
[3] is the new value that is expected to be saved.

We can then query item [1], [2], or [3] in our script as needed.

Example:

cr::zMyScript(...){
  if( is_null( argv[3]){
    set_error( 1);
    set_return_data( "Assignee needs to be filled.");
    };
  };
This page was last modified 17:49, 16 July 2010.  This page has been accessed 1,285 times.  Content is available under Attribution-Noncommercial-Share Alike 3.0 UnportedDisclaimers