How to Hide Select Box Options populated by a Choice Table & Field -- Variable Type Specifications

Hayden Reid
Tera Guru

Good afternoon!

 

We seem to be having some issues removing options from a select box dropdown that points to a Choice Type variable with 6 choices. Our onLoad client script does run, but the '.removeOptions' method doesn't seem to be working as expected. Ideally, our goal is to remove the options "Accepted", "Revoked", and "Did Not Respond" from the select box.

 

Here's how the Family Size Select Box is configured: 

family_size.png

 

 

Type Specifications points to GO Family Status (Choice Variable with 6 choices):

Family Status Setup.png

 

GO Family Status Variable with the 6 choices (used by two different HR Services):

 

u_go_family_status_setup.png

onLoad Client Script:

 

clientscript_wfm.png

 

And the result from the fulfiller view... :

 

familysize_err.png

 

Any suggestions for where our client script might be going wrong? Are we calling the wrong methods for select boxes that rely on a Choice Table specification? Are we dot walking to the variables incorrectly?

 

Any suggestions would be greatly appreciated.

 

Thank you!

 

Hayden

 

 

 

2 REPLIES 2

Claude DAmico
Kilo Sage

I used my PDI to create a test catalog item for this. I ended up only adding a single variable (test_question) that references the Incident choice table and Category choice field. This resulted in a total of 5 options listed in the Select Box.

 

Then, I created an onLoad test client script that looks like this:

function onLoad() {
   //Type appropriate comment here, and begin script below
   g_form.removeOption('test_question', 'inquiry');
}

 

When I tested the catalog item, the option I wanted removed was removed. The difference between yours and mine only being how I called the variable. I didn't include 'variable.' at the front so maybe try g_form.removeOption('family_size', <value>); instead?

Claude E. D'Amico, III - CSA

Hi Claude,

 

Thanks for the suggestion, unfortunately this still didn't seem to resolve the problem. Currently the three options "Accept, Revoked and Did Not Respond" are all hidden when looking at the catalog item. The problem of all options being present appears after the case has been created and our fulfillers view the case on the back end under the Custom Variable Editor.

 

From what I can tell, only the choices that share the same table as the record producer will have those corresponding choices shown. When viewing the Select Box dropdown within the Custom Variable Editor section at the case view level, it shows all choices from all tables belonging to a sys_choice record.