clear the sys_id in GlideList field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 08:49 AM
Hi All,
Consider the below scenario and help me in solving it
I have created a "List" type field in Incident form and it is referenced to "User" table.
I added a user to the "List" type field in Incident form. After that. I deleted the same user in "User" table . Now i am able to see a sys_id in the "List" type field in Incident form.
So help me like, if i delete the a user in "User" table, it should also delete its value in the referenced fields("List" type field in Incident form) and it should not display any sys_id.
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 08:55 AM
There is a field on the dictionary called "Reference cascade rule." You would select "Clear: Clears the references (default)."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2018 03:40 AM
Unfortunately Cascade Rule do not work for GlideList fields, only for Reference fields, although the Cascade Rule selection is displayed for GlideList fields.
I have created an Incident for this last summer and Customer Support told me that it is expected behavior, but they have created a Feature Request which is currently in status "Under Consideration".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 08:57 AM
Hi Dcn,
For this you need to have before delete business rule on user table and do following:
1) query incident table and search records which have this current sys_id in the glide list field.
2) if record found then take all the sys_ids from the glide list and remove this deleted record sys_id and update the incident record once again
Example:
INC1 has User1, User2, User3 in glide list
if user 2 is getting deleted
in the query you will get this INC1 since the glide list column contains user 2
get the value remove user 2 from that and populate only User 1 and User 3 back in glide list field.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 09:17 AM
Hi Ankur,
I have a doubt, how to get the details of user(whose record is being deleted) in business rule.
Eg: Assume User1 is being deleted and we need to query to get the incidents with User1 in glideList. How we will get the details User1 in Business rule
Kindly provide a example code snippet.