Setting If Conditions on Catalog Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 11:59 PM - edited 08-03-2023 12:02 AM
This is my catalog client script, I basically autopopulated the data to the portal , the data is coming from the backend (I also used script include for this) but I want to have a If statement that depends on the other variable
Note: I already got the values (autopopulated) coming form the backend, but I want a if statement on when it will be showing to the portal. I want if "select_request_type" (this is my other variable) is "new_privileged_admin_account" (its option) is selected then it will only populate show/set value the data on that time, else it will be blank since my variable ("team") is not mandatory & it is read only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 12:13 AM - edited 08-03-2023 12:17 AM
You can do one thing just create the onChange client script on "select_request_type" and mentioned below script:
if(newValue == "new_privileged_admin_account"){
//your Script here
}
OR if you want to update the same script, you can mention like below
if(g_form.getValue("select_request_type") == "new_privileged_admin_account"){
//your script here and dont make glideAjax if you dont want to set the values
}
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:48 PM
hi @Blitz ,
you can use this after line 14 & delete line 15
if(g_form.getValue("select_request_type") == "new_privileged_admin_account"){
g_form.setValue('team',answer);
}