Cross scope privilege - update() in business rule

kris29
Tera Contributor

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.

 

1 ACCEPTED SOLUTION

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.

View solution in original post

4 REPLIES 4

Mike_R
Kilo Patron
Kilo Patron

can you post your code? I hope you're not using current.update()

kris29
Tera Contributor
 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(); 

 

kris29_0-1665605840965.png

 

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.

kris29
Tera Contributor

thanks for the clarification, somehow I just overlooked that