Assigned to should not be filled if Assignment Group Field is Empty on Incident Form

SNOW46
Tera Contributor

Hi All,

I have one requirement that user cannot able to fill the Assigned To cannot be filled without Filling the Assignment Group.

Can anyone suggest me how to impose the restriction in SNOW?

 

Regards,

SNOW@Das

 

 

17 REPLIES 17

Actually I have already defined the below client script for the same.

Can you please let me know so that I can update in the same code.

 

find_real_file.png

RajuThelu
Mega Guru

Hi Snow@Das,

You can write ui policy 

Condition:Assignmnet gruop isempty

find_real_file.png

 

You can create ui acction on this condition.

Condition:Assign To Readonly

 

Regards

Raju Thelu

 

SNOW46
Tera Contributor

Hi Raju,

Can't I add some code in my above mentioned Client Script?

 

 

You can use g_form.setMandatory('field_name', boolean) and g_form.setReadOnly('field_name', boolean) to make a field mandatory or read only in a client script. It's best practice to use UI policies in most cases though.

The assignment group is always going to be a mandatory field, there's no reason to only make it mandatory when someone tries to add an assignee, you might as well have it mandatory when the form loads so your users don't waste time looking for assignee's only to be thrown an error.

All you need is a UI policy with the condition 'Assignment group is empty' and you can add policy actions to make the assignment group field mandatory and the assigned to field read only. 

99% of the time, if you're making fields visible/mandatory/read-only the best thing to use is a UI policy

Gagan10
Giga Contributor

You can create UI policy for that with condition :-

If Assignment Group is empty : Set Assigned to field "Read Only" .

OR

If Assignment Group is empty : Set Visibility of Assigned To field to "False".