Catalog UI Policy Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 06:42 AM - edited 11-23-2023 09:28 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 09:36 AM
Hello this is a catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 09:43 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 09:53 AM - edited 11-23-2023 09:29 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 09:59 AM - edited 03-15-2023 10:00 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 10:14 AM - edited 11-23-2023 09:30 AM
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.