- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
β07-12-2024 03:10 AM
hi @kartikey
The u_bulk_updated field doesn't get checked or unchecked directly from the list view. Instead, the business rule we created earlier handles the setting of this field.
Here's how the process works when you perform a bulk update on 20 or more records:
1. Bulk Update Action: You select multiple records (20 or more) in the list view and click the "Update All" button.
2. Business Rule Trigger: The "before update" business rule we created is triggered for each of the selected records.
3. Condition Check: The business rule checks the current.operation() value for each record. Since it's a bulk update, current.operation() will return 'update_multiple'.
4. Update Field: Because the condition is met, the business rule sets the u_bulk_updated field to true for each of the 20 (or more) records being updated.
5. Database Update: The records are updated in the database, and the u_bulk_updated field now reflects that these records were part of a bulk update.
Important Note: The u_bulk_updated field is not a checkbox field that you can manually check or uncheck on the list view. It's a "True/False" field, and its value is automatically set by the business rule based on the update operation.
How to Set Up the Business Rule:
1. Table: Choose the table on which you want to track bulk updates.
2. When: "before" (Before the update is saved to the database).
3. Insert: Unchecked.
4. Update: Checked.
5. Delete: Unchecked.
6. Advanced: Unchecked.
7. When to run:
* Condition: current.operation() == 'update_multiple'
* This condition is crucial as it ensures that the business rule will only trigger when a bulk update is performed on the records.
8. Filter Conditions: Add any additional filter conditions if you want the business rule to apply to specific records within the table (optional).
9. Script: Paste the provided script into the script field
(function executeRule(current, previous /*null when async*/) {
// Check if the update is triggered by the "Update All" action
if (current.operation() == 'update_multiple') { // This is the key condition
current.u_bulk_updated = true; // Set custom field to true
}
})(current, previous);
A small request from my end, If you like this opinion and your problem is resolved after reviewing and applying it. Please kindly mark this your best answerβπ β OR mark it Helpful βββ if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community