What Data Can You See in a Business Rule?
- Local variables declared in a script
- Predefined server-side Global variables:
current
previous
g_scratchpad:
- Display Business Rules only
- Works in conjuction with a client-side script
if (current.state >= 5 && previous.state < 5) {
var reOpened = true;
g_scratchpad.createdBy = current.sys_created_by;
g_scratchpad.caller = current.called_id;
}
Description
current is an object that stores the current record's fields and values; new/modified values. A script can change a field's value name many times, current will store the most recent value. For example:
if (previous.priority == current.priority){
return;
}
previous is an object that stores the record's fields and values before any changes were made; the original values when the form loaded. Reference this object using previous.<field_name>. For example:
if(previous.priority == 1){
//logic here
}
IMPORTANT
The previous object is not available in a Async Business Rules.