Processes changes requested by the user and stores them in an xml file.
You should call this method at the end of your script to make your changes available to . For example, the script may have changed the value of a field, this change will be ignored, unless it calls "save" prior to exiting.
If you used
|
EWset::setRecordField($fieldName, $fieldValue)
Assigns a value to the specified field in the record or sets the field to NULL if the value is undefined.
To set the value of the "email" field in the current record
Comment |
See Stringifiers Description for full description of acceptable formats for each type of data.
See also Linked Fields in Scripts chapter for more information.
Determines what happens when the script exits. Option parameters are enclosed in double quotation marks.
Allowed options are:
As an alternative to setExitAction, provided for compatibility with languages that do not allow strings to be returned, the script can provide an exit (return) code.
Formally speaking this function sets the value for the tag 'exitAction'.
Send a message to the user.
This message will be shown to the user if the script is executed because the user has changed a record in GUI. Formally speaking, this method sets the value for the tag 'message'.
|
When a script blocks a record edit, it is a good practice to use setMessage to explain why the change was blocked and what the user should do. Of course, it can also be used to confirm success or provide some other message.
Sets the value of the URL that the user should be directed to if the script logs them out of
The redirect URL should be absolute and include "http". It will be opened in the same browser window. Formally speaking, this method sets the value of the tag 'redirect'.
|
It is useless to call setMessage() with setRedirect since there will be no page shown to display the message.
The following functions are mostly used for debugging scripts.
EWset::setDebug($debugMessage) |
Write to the log file (formally speaking, sets value for tag 'debug').
This message is saved to the log. It can be useful for logging the result of a script or to debug the script.
Sets a value in the record history
This message is stored in the record history. Formally speaking, this method sets the value for the tag 'report'.
Note: It is sometimes helpful to write a description of what the script did to the data and why.
Combination of functions EWSet::setExitAction($exitAction) and EWset::save($outfileName) with the same arguments and meanings.
The function is able to get an exitCode directly, as $exitAction argument, thus the following pairs of values are equivalent: "AcceptChanges" or 0 or "0" "RejectChanges" or 1 or "1" "RejectChangesAndExit" or 2 or "2" "AcceptChangesAndExit" or 3 or "3" |
Related articles |