What is current?
In a Business Rule, current is a GlideRecord object representing the record being processed. In Before rules, it contains the new values being saved. In After and Async rules, it contains the saved values.
What is previous?
previous contains the field values from before the current operation. In an Update operation, previous.state gives you the state before the user's changes.
if (current.state != previous.state) {
gs.log('State changed from ' + previous.state + ' to ' + current.state);
}
previous in Insert operations
When a record is being inserted (not updated), previous is an empty GlideRecord. All fields will return empty values. Always check the operation before using previous:
if (current.operation() == 'update') {
// Safe to use previous here
var oldState = previous.getValue('state');
}
previous in Async rules
This is where most developers get caught. In Async rules, previous often does not contain the expected pre-change values — by the time the async rule runs, the original values may no longer be reliably available. Do not rely on previous in async rules for important logic. Capture what you need in a Before or After rule and store it on the record or in a separate table if needed.
Checking what changed
// Check if a specific field changed
if (current.state.changes()) {
// state was modified in this operation
}
// Get the previous value of a specific field
var oldAssignee = current.assigned_to.getOldValue();
current.operation()
Returns the DML operation: 'insert', 'update', or 'delete'. Always check this when your rule logic depends on it.