Updating the value of certain field in a number of records from User table using Background Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2023 02:42 AM
Hi, Need help in writing the background script!
Below is the requirement:
I have a custom table which has a Country field in it and it is populated based on user selected in the field Engagement Partner and my requirement is to update the Country field value in this custom table for a number of records by searching the the user from "User" table and picking up the value of Country from User table and updating the value into Country field in custom table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2023 04:55 AM
As Ankur said, if you design the script, someone will help you in making it work. Here are the steps to design the script to fulfill your requirement
- "GlideRecord" the custom table you created
- Add the "encodedQuery" as per your requirement the "Query' it
- Within the while loop, query the sys_user table with the encodedQuery of sys_id=u_engagement_partner, and then query it
- Get the value of the country field set that value in your custom table field and then update it.
Would you mind designing a script and come back to here, will help you then.
Best Regards,
Tarun