Hide question choice on catalog item

shembop
Tera Contributor

So, I have a catalog item where I used a Select Box for a variable, and set a bunch of Question Choices.

Fast forward 2 years, and one of the choices needs to no longer be on there. But... there is no way to inactivate the choice.

How would you make it no longer be a choice on the request form, but still exist on old requests, in reports, etc.

4 REPLIES 4

ccajohnson
Kilo Sage

You should be able to write a Catalog Client Script that runs only on the Catalog Item Form that hides the choice.

Moy1
Kilo Guru

You can write an onLoad client script:

function onLoad() {
      g_form.removeOption('field name', 'option');   //replace field name and option with your own
}

Thanks, Moy!

I found that your onLoad Catalog Client Script does not work on Multiple Choice variables but it does on Select Box variables for some reason.

Best regards
Thomas

Bel Ngiam
Kilo Contributor

I have a similar question except that if the requested item (created from the catalog) is not approved yet, I would be able to amend the field and the field should hide the choice. 

The script works on the catalog item but it is not working in the requested item view even though "Applies on Requested Item" is already checked. Any clue? I tried to create a new OnLoad client script at the requested item level but it is not working as expected.