- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 02:41 PM
Desired Solution: I need a business rule to trigger on the core_company table to glide over to another table and update a value on that table. The matching condition is a value called the 'u_branchkey' which is a 3 digit number.
I've gone through the code a few times, tried a few different solutions but nothing seems to be successful in getting the action to function as expected.
I've confirmed in my testing, that the field 'u_branchkey' is accurate and exists on both the core_company and the u_agency_it_state_tracker tables. The value is 100 for both, so as far as I understand, the query should be going to the agency table, and finding what matches 100, then proceeding to update that record.
I've successfully been able to create/insert records on the table so I know the communication to the target table isn't hindered (we also have other processes that work and communicate with our agency table).
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 02:54 PM
You don't need "==" in your business rule script.
Update your code like gr.addQuery('u_branchkey',current.u_bkey);
Also, i hope that this custom branch key field on company table is a reference field to your custom table in which you are updating records.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 02:54 PM
You don't need "==" in your business rule script.
Update your code like gr.addQuery('u_branchkey',current.u_bkey);
Also, i hope that this custom branch key field on company table is a reference field to your custom table in which you are updating records.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2022 09:19 AM
The strangest thing is I actually had it in that format from the beginning but was trying a few different things out when it didn't work, guess I just had something else wrong at the time of setting that up.
It isn't a reference field though, it still worked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 02:57 PM
Hi,
As has been mentioned, it's a formatting issue.
Also, the screenshots were great, but please include the script in your post in the future and you can use the "Insert/Edit code sample" feature as well:
For the formatting of the GlideRecord query, here's documentation to look over as well: https://developer.servicenow.com/dev.do#!/reference/api/paris/server/no-namespace/c_GlideRecordScope...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2022 09:19 AM
Ah ok I will remember that going forward, thank you!