- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 07:35 AM
Hey everyone,
I have a service catalog item where I created a new Yes/No field called "Have you tried the "Forget Your Password" option on the SF Login Site?" If the user selects "No" then a popup should display with directions.
I created an onChange client script and it does not do anything. I've confirmed that Active and Global are checked, the UI type is All, it's in the sc_cat_item table, type is onChange, and the script is below. What could I be missing?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//User selects NO, this is the message they see
if (newValue === 'have_you_tried_the_forget_your_password_option_on_the_sf_login_site' == NO){
alert(getMessage('Please use the password reset from the SF Login Site before submitting this request.'));
}
}
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 08:55 AM
Hi @nebula,
Make sure you have created Catalog Client scripts instead if Client scripts.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 07:39 AM
Hi @nebula,
Try this updated scripts -
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//User selects NO, this is the message they see
if (newValue == "NO") // add correct value no/ NO {
alert(getMessage('Please use the password reset from the SF Login Site before submitting this request.'));
}
}
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 07:48 AM
Unfortunately, it did not work.
To confirm, (and should have mentioned in the original post), I have checked my browser's pop-ups so I know it cannot be that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 07:50 AM
Hi,
Make sure you have selected the correct field/variable in field on catalog client scripts form.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 07:54 AM
Good catch - I have the Field Name as --None--. Is there a generic option to select for that field since I had created the variable? I'm trying to understand the Field name function but am having trouble finding online resources.