Business rule for Variable set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:18 AM
Hi,
Can some one write me the code of a business rule which needs to fetch the Variable set on catalog item ?
Basically , I need to auto populate OR add variable set to Catalog Item when the category is software and another field is set to true.
I am not very sure how to read the variables in variable set. I need both variables ( 2 check boxes ) need to be fetched via Business rule .
Can some one help ?
regards,
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 04:15 AM
Hi @New Developer_S ,
When the Category is software and the check box for Confirmation of data protection and information security training required is checked. For this requirement you can create one UI Policy on your catalog item table [sc_cat_item] and under when to run condition select the category variable and in that select the value , see below screenshots :
And using g_form API you can select the variable name and set the value.
About retrieving variable set what do you mean , and also please post the screenshot of the UI Policie on catalog item.
Please mark helpful/correct if my response helped you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 04:41 AM
I am looking for Catalog Client Script and glide Ajax for this requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 03:26 AM
Hey @New Developer_S ,
This is the API reference with which you can access catalog items inside variable set.
Here is the one of the example for your reference...
In this , a catalog item for blocking multiple IP addresses on a firewall has a variable address_type with two choices - IPV4 and IPV6. The MRVS has two variables (ipv4_address and ipv6_address) for the respective address types. If the Address type field on the parent form is set to IPV4, the field IPV6 address is hidden on the MRVS.
function onLoad() {
if (g_service_catalog.parent.getValue("address_type") == "ipv4") {
g_form.setValue("ipv4_address", "XX.XX.XX.XX");
g_form.setVisible("ipv6_address", "false");
}
}