Closure codes dependent on assignment groups

Puneet4418
Tera Contributor

Hi Experts, could you please assist me on below requirement.

we have few groups with suffix “Apps-“. The requirement is, whenever these groups are selected under incident form, we have to display a particular closure code and make that closure code field as read only.

3 REPLIES 3

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
You can do this using onChange client script.




Thanks and Regards,

Saurabh Gupta

Sai Shravan
Mega Sage

Hi @Puneet4418 ,

 

Below is the sample code you can give a try :

 

function onLoad() {
    if (g_form.getValue('assignment_group').endsWith("Apps-")) {
        g_form.setReadOnly('u_closure_code', true);
    }
}

 

Note : Make sure the group name ends with Apps- (case sensitive ) 

please mark this as helpful and correct answer if this helps you

Regards,
Shravan
Please mark this as helpful and correct answer, if this helps you

AparnaSahu
Tera Guru
  1. Yes possible via before Business rule

Condition : State Changes to Resolved and Assignment Group start/end with "Apps-"

Add in Script –

current.close_code = "";

current.update();

 

 

 

  1. Also Can be done via onChange clientScript on State

Script-

var getAssignGroup = g_form.getDisplayValue('assignment_group');

var getState = g_form.getValue('state');

if(getState == 6 && getAssignGroup.indexOf("App") >-1){

g_form.setValue(‘close_code, ‘ ’);

g_form.setReadOnly("close_code ",true);

 

}