Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

OnSubmit Client script to set value of assignment group

Deepika Mishra
Mega Guru

I am trying to set value of assignment group using client script on onSubmit functionality, but the below code is not working. Please help :
find_real_file.png

1 ACCEPTED SOLUTION

Michael Fry1
Kilo Patron

You should use an Assignment rule. All that script is doing is setting an assignment group variable, not the assignment group on the record.

View solution in original post

29 REPLIES 29

It is not working 😞

Raghav Sharma24
Giga Patron

Are you trying to set assignment group on task based on some variable value?

It can be achieved by task activity in workflow:

 

if(current.variables.authority=='tax')

{

task.assignment_group='sys_id';

}

current can't be read in catalog client script

This code is for workflow task activity not for client script.

You can achieve this through workflow easily

akashvarma85310
Tera Contributor

Without client script, we can achieve this;  you can add the script in record producer

 

(function producerScript(current, producer) {


var inc = new GlideRecord('sys_user_group');
inc.addQuery('name', 'ABC');
inc.query();
if (inc.next()) {
current.assignment_group = inc.sys_id;
} else {
gs.error('Assignment group "ABC" not found');
}
})(current, producer);

 

Thanks,

Akash