setVariable()
Last updated 31/01/2024
Example
This code is setting the global variables ISBN
, Title
, and UserKey
using the setVariable()
on the Five
object. The variables can then be accessed by using either
the
Five
object, or using the function on the Five
object.
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);
}
Set the global variables for the fields ISBN, Title, and UserKey
function SetSearchISBN(five, context, result) {
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);
}