Skip to main content

setVariable()

Last updated 12/09/2024

Example

The following code is setting the global variables

ISBN
Title
UserKey
using
setVariable()
. The variables can then be accessed either by the
variable
property or the
getVariable()
function.

Set the global variables for the fields ISBN, Title, and UserKey
function SetSearchISBN(five: Five, context: any, result: FiveError) : FiveError  {
five.setVariable('ISBN', five.field.ISBN);
five.setVariable('Title', `%${five.field.Title}%`);
five.setVariable('UserKey', five.currentUserKey());
five.refreshTable('Book');
five.refreshTable('iUser');
return five.success(result);
}