Remove option from selection box in record producer

Laura12
Tera Contributor

In my record producer, the first selection the user must make is to select an application, which is mapped to the business service field on the Incident.  After they select an application, they need to select if they need access, have a question, or have an issue regarding that application.  There are two applications within the list, DocuSign and Jigsaw, that if they are chosen I need to remove the option for 'I need access' in the drop-down and I don't know how to do this.  I assume through a client script but I know nothing about writing scripts so I need some help.  I have added the screenshots of the two fields.

3 REPLIES 3

Tudor
Tera Guru

Hello Laura,

For that, you will require an onChange catalogue client script on the field which maps the business services.

g_form.clearOptions('name of field which maps selections');

if (newValue == "sys_id of DocuSign" || newValue =="sys_id of Jigsaw"){

g_form.addOption("name of field which maps selections","name of choice - I have a question");

g_form.addOption("name of field which maps selections","name of choice - I have an issue");

}

else{

g_form.addOption("name of field which maps selections","name of choice - I need access");

g_form.addOption("name of field which maps selections","name of choice - I have a question");

g_form.addOption("name of field which maps selections","name of choice - I have an issue");

I hope this helps!

 Tudor

 

Laura12
Tera Contributor

Hi Tudor,

First, thank you for your help.  I created the catalog client script and added the code but now I'm getting a 'Parsing Error: Unexpected token' and I'm not sure what that means.  The curly brackets after the else and at the end are marked as "red".  Any help would be appreciated.

Laura12
Tera Contributor

Disregard my last post - I was missing a curly bracket.

So, I added the client script and ran the form, but when I selected DocuSign, the "I need access" was still in the drop-down.  Here's what I have:

 g_form.clearOptions('short_description');
if (newValue == "ee8e7f1fdb1e8380443b323b7c96193f" || newValue =="4f9f48251b54811038e48443cc4bcb10"){

g_form.addOption("short_description","PASS Form Request - Question - I have a question");

g_form.addOption("short_description","PASS Request Form - Issue - I have an issue");

}

else{

g_form.addOption("short_description","PASS Request Form - Access - I need access");

g_form.addOption("short_description","PASS Form Request - Question - I have a question");

g_form.addOption("short_description","PASS Request Form - Issue - I have an issue");

}
}

I'm not sure if I've added too much information to the script.  Also, should the variable name be short_description?