Catalog UI Policy Script

oww15
Tera Contributor

Hello everyone!

 

Can someone help me with the catalog UI policy script? I need to show the download link field if the product field is not VPN. However, the product field is populated through a client script. How can I make a script for this one? Thanks!

 

12 REPLIES 12

oww15
Tera Contributor

Hello this is a catalog item. 

In that case either app_req_template is also a variable and then you can (should) do what I have suggested - a Catalog UI Policy with a Catalog UI Policy Action.

Or app_req_template is not a correct field name - there is no such field OOB as far as I can tell, which means it must be a custom field with means it should start with prefix u_.

So is app_req_template also a variable, or is is a custom field - in which case what is its correct name?

oww15
Tera Contributor

app_req_template is a rich text label variable in the catalog item

 

If I will be using a catalog ui policy it will not meet my requirements since values for product is empty as the values comes from the client script. See screenshot below

 

 

Now I understand what you mean: the choices are added dynamically by a Client Script.

Well, the proper thing to do is to change variable product into a variable of type Lookup Select Box, define the choices, add a reference qualifier to achieve the same effect as the one provided by the Client Script that adds choices dynamically.

And then you can use Catalog UI Policies.

 

But if you insist on doing it wrong, change the script as described above; use

 

g_sc_form.getValue('product') == 'VPN'

 

This is assuming that the choice value (not label) is indeed VPN.

Though the policy will only be applied one, one load.

Another option is to just use an onLoad Client Script.

oww15
Tera Contributor

Initially, that is what I'd like to do but the product field is dependent on the type of request. Wherein the value changes for the product field if the type of request changes. And the choices for the product field are so many.

The reason why I am trying if this is feasible with the catalog ui policy script.