While changing the state to Resolve Service offering field value should be empty?

Manikanta G
Tera Contributor

My requirement is:

 

By using 'Resolve' UI Action in Incident, While changing the state to 'Resolve' from 'Inprogress', Service offering field value should clear and assignment group/assigned to  need to fill the service offering field. I am done this, but again If I am clicking the Resolve UI action after updating the service offering, the form is not saving, again it is clearing the service offering value.

 

Please help me on After updating the Service Offering value, the form should save and service offering value should be update.

 

Thanks,

ManiKanta

 

 

 

1 ACCEPTED SOLUTION

Harish Kota
Kilo Sage

Hi @Manikanta G 

 

Write onChange Client script on Incident form, Please use below code for your requirement.

 

Client Script:

Type: onChange

Field Name: State

 

//Add your script here

if(isLoading || newValue === '') {

return;

}

 

if(oldValue == "2" && newValue == "6" && g_form.getValue("assignment_group")  && g_form.getValue("close_code") == "None" || g_form.getValue("close_code" == ' ') {

 

g_form.clearValue(''service_offering");

 

//add error message, if required

 

g_form.addErrorMessage('Fill the Mandatory Values and click on Resolve);

}

}

 

Please test this code in your non-prod instance and test thoroughly before moving to prod.

 

Please hit like/Accept as solution, if it works for you.

 

Thanks,

Harish Kota

View solution in original post

2 REPLIES 2

Harish Kota
Kilo Sage

Hi @Manikanta G 

 

Write onChange Client script on Incident form, Please use below code for your requirement.

 

Client Script:

Type: onChange

Field Name: State

 

//Add your script here

if(isLoading || newValue === '') {

return;

}

 

if(oldValue == "2" && newValue == "6" && g_form.getValue("assignment_group")  && g_form.getValue("close_code") == "None" || g_form.getValue("close_code" == ' ') {

 

g_form.clearValue(''service_offering");

 

//add error message, if required

 

g_form.addErrorMessage('Fill the Mandatory Values and click on Resolve);

}

}

 

Please test this code in your non-prod instance and test thoroughly before moving to prod.

 

Please hit like/Accept as solution, if it works for you.

 

Thanks,

Harish Kota

Thank you very much harish, solution worked for me.