- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2019 05:06 AM
Hi Team,
I am trying to auto set assignment group based on conditions but it is not working.
The requirement is while creating a new case if Product (Reference field to Product table)= 'Alokproduct' and Feature(Reference field to Product table) = 'Alok feature', then the Assignment group for that case should be auto Populated with "Case support group". I have created a before insert BR with below code.
if(current.isNewRecord()){
var product = current.getValue('product');
var feature = current.getValue('u_feature');
if (product == 'Alokproduct' && feature == 'Alok feature'){
current.assignment_group = '9d55d96f292200da6f08c6eb3ee442';
}
}
Note: There is already an assignment rule which is auto populating the assignment group on a different condition. My condition is different and i want to over write the group when my conditions are satisfied.
Can someone please assist?
Regards,
Alok sahu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 12:25 AM
As the assignment rule you mentioned is already in place, you will need to keep this BR to overwrite it
because assignment rules trigger after the form is submitted.
If you still want the users to see the change client side(on the form) then additionally you will have to write 2 onChange Client Scripts.
1. for product field:
if(newValue == 'sys_id of Alokproduct' && feature == 'sys_id Alok feature')
g_form.setValue('assignment_group','9d55d96f292200da6f08c6eb3ee442');
2. for feature field:
if(newValue == 'sys_id of Alok feature' && product== 'sys_id Alokproduct')
g_form.setValue('assignment_group','9d55d96f292200da6f08c6eb3ee442');
Please mark as correct/helpful if this helps! 🙂
Thanks
DR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 01:59 AM
Hi Debopriya,
I created only 1 client script and it is working fine now. The only issue is, for existing record when i go and change the condition per my requirement it is setting the group and i dont want that. How can we put control on this?
Regards,
Alok sahu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 02:08 AM
Forgot to add the check for only new records!
Modify Client Script as follows:
if(g_form.isNewRecord())
{
g_form.setValue('assignment_group','');
if(newValue == 'sys_id of Alok feature' && product== 'sys_id Alokproduct')
g_form.setValue('assignment_group','9d55d96f292200da6f08c6eb3ee442');
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 02:22 AM
why u r going to script u write the assignment rule
Thanks,
Rahul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 03:14 AM
It is not working with assignment rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2019 04:30 AM
Hi Alok,
Please mark the answer as helpful/correct if this helped solve the query.
as Rahul has mentioned you can replace the BR with an Assignment rule, you have set the order higher than that of the existing AR.
Thanks
DR