
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2021 07:39 AM
I am trying to set value of assignment group using client script on onSubmit functionality, but the below code is not working. Please help :
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2021 08:12 AM
You should use an Assignment rule. All that script is doing is setting an assignment group variable, not the assignment group on the record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2021 08:54 AM
So, to understand how to set up an "Assignment Rule" check this link,
Many thanks,
Kind regards
Director of Globalization Deployment, Internationalization

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2021 11:33 AM
Module name is Assignment rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2021 08:12 AM
Hi,
you should be using normal client script for this and not Catalog Client Script.
if authority is a variable then use this syntax to get the value
function onSubmit(){
if(g_form.getValue('variables.authority').toString() == 'true'){
g_form.setValue('assignment_group', 'sysIdHere');
}
}
Regards
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
‎03-19-2021 08:19 AM
you should be using normal client script for this and not Catalog Client Script - will it work on portal then ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-19-2021 08:28 AM
Hi,
yes it would work on portal as well when you open the record in form page
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader