- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 12:05 PM
Hi,
I need to write a script to fill ina glide list with 3 values, assigned_to, caller and opened_by. Please see screenshot below. Should it be a client script, UI policy or what? How do I access this glide_list (u_users_enabled_to_access_case)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 07:44 AM
This wouldn't work as a client script, as it is using current, which is in the server-side API.
Can you post a screenshot of your business rule? It should be set to run Before. If you have it running After, it would not work, as there is nothing telling it to write to the database. Before business rules have an inherent "current.update()" after all Before BRs have completed.
Also, make sure the field names are correct in the script. Are any of the values going into the GlideList field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 12:53 PM
GlideList fields are just comma-separated sys_ids or email addresses in the case of a User reference. In an onBefore business rule, you can just build an array, join the values, and then set the field. You could also do this in a client script or in a script within a UI policy, but a business rule is the best way.
var userList = [];
userList.push(current.assigned_to);
userList.push(current.caller_id);
userList.push(current.opened_by);
current.u_users_enabled_to_access_case = userList.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2018 04:17 PM
Thanks Tim,
This worked. However it did not work as a business rule or as a client script. I placed it in the record producer 'what it will contain' script that created the case and it worked. It's an HR catalog item. Do you have any idea why it did not work as a business rule or a client script?
Much appreciated - thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2018 09:54 AM
Tim,
Do you have an answer to my question? Do we refere to these fields differently?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2018 07:44 AM
This wouldn't work as a client script, as it is using current, which is in the server-side API.
Can you post a screenshot of your business rule? It should be set to run Before. If you have it running After, it would not work, as there is nothing telling it to write to the database. Before business rules have an inherent "current.update()" after all Before BRs have completed.
Also, make sure the field names are correct in the script. Are any of the values going into the GlideList field?