- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 12:28 PM - edited 10-12-2022 01:22 PM
Hi folks,
Why do we need to use update() in the business rule in scope app? I just want to understand why it does not work when I don't use update() in scope app.
I created simple BR on before and it does not work without update(). Once I added update, required field will be updated on custom table and cross scope privilege will be created.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 01:26 PM
Since you are modify another record/object through a script/GlideRecord, that's why you need update() to complete the operation.
If you were just modifying the current object (record that the business rule is running on), then you wouldn't and shouldn't use update() because the BR automatically updates the record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 01:04 PM
can you post your code? I hope you're not using current.update()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 01:17 PM
var grSand = new GlideRecord('x_392627_sandbox_test');
grSand.addQuery('parent', current.sys_id);
grSand.query();
while (grSand.next()) {
grSand.description.setValue("Test description");
grSand.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 01:26 PM
Since you are modify another record/object through a script/GlideRecord, that's why you need update() to complete the operation.
If you were just modifying the current object (record that the business rule is running on), then you wouldn't and shouldn't use update() because the BR automatically updates the record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 01:50 PM
thanks for the clarification, somehow I just overlooked that