change field values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 11:39 PM
Hello,
I was wondering if this is correct to use a business rule to change the field value of records if a record from another table changes to "approved"
So the "Expense App" record (contains data like requestor, status, year, month) can be approved by a manager. When this happens UI Policy is triggers that changes the status to "approved" . Below you can see records that come from another table, they as well have fields like requestor, status, year and month. I want the status field to change for all records that have the same requestor, month and year.
here is my business rule however it does not work:
any tips on how to make it work??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 11:43 PM
Hi @hadron_collider ,
Are you getting this info message?
gs.info("Updating record: " + gr.sys_id);
Once the BR is executed or is the BR getting executed?
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 11:53 PM
Hello @hadron_collider ,
your script logic looks fine, but you might have problems with the cross-scope problem, is the table that you are triggering the business rule in the same scope as the table that you want to update the records?
I hope that this helps you!
If the provided information answers your question, please consider marking it as Helpful and Accepting the Solution so other community users can find it faster.
All the Best,
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 12:48 AM
Hello,
Thanks for looking into this.
Indeed, both tables are in the same scope
any further suggestion what can be done to make it work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 02:24 AM
Hi @hadron_collider ,
Are you using an admin user, event then there might be an ACL preventing you from doing that, or a data policy.
You can test the script in a background script to check if the updates are executed. If they are done there might be another business rule or something else updating them back.
Hope that this helps you!
If the provided information answers your question, please consider marking it as Helpful and Accepting the Solution so other community users can find it faster.
All the Best,
Stefan