Need to dynamically hide Order Now button in Service Catalog?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 01:52 AM
I need to dynamically hide Order Now button in Service Catalog?
My script checks for the status of a field in the related table and if it finds the matching status, it should hide the Order Now button. Please help me to achieve this.
Here is my script along with the screen shot but it doesn't work.
Catalog Client Script Onchange
function onChange(control, oldValue, newValue, isLoading) {
var caller = g_form.getReference('nh_new_user', doAlert);
function doAlert(caller) {
g_form.setValue('profile',caller.u_equipment_profile);
if(caller.u_state == "Processing")
{alert("Manager Checklist for this User has already been Submitted");
$('order_now').hide();
}
}
}
This doesn't work, I can hide it by directly going to the catalog item and check no order to true but that hides it permanently.. where as I want to dynamically hide it.
Please help
Regards,
Raju Singh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 02:13 AM
try this
document.getElementById('order_now').style.display='none';
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 02:25 AM
Are you getting alert message?
If not, then check the value of Processing not the Display Name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 03:04 AM
No, I am not getting the alert message too.. The value of u_state == Processing and its correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 03:05 AM
You are right Nayan.. I am not getting the alert message at all.. I m not sure, why am I not getting..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2017 03:11 AM
Write Alert before If Condition and check what value you are getting.
alert(caller.u_state);