| Name | Type | Description |
|---|---|---|
| record | sys.data.Record | The record where the action will be executed. This variable is only available if the type of the action is |
| oldRecord | sys.data.Record | The record before linked parameters are merged. This variable is only available if the type of the action is |
| query | sys.data.Query | A query object with filters to find all records afected by this action. This variable is only available if the type of the action is |
| action | sys.data.Action | This allows access to the parameters of the action. |
//updates some values in the record and save it
var newValue = action.field('param1') * 10;
record.field('field').val(newValue);
sys.data.save(newValue);
//many records actions that sums up the number of employees on selected companies
var total = 0;
var records = sys.data.find(query);
while (records.hasNext()) {
total += records.next().field('numberOfEmployees').val();
}
return total;