Need to dynamically hide Order Now button in Service Catalog?

Raju Singh1
Tera Expert

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

16 REPLIES 16

try this


document.getElementById('order_now').style.display='none';


Regards
Harish

Are you getting alert message?


If not, then check the value of Processing not the Display Name.


No, I am not getting the alert message too.. The value of u_state == Processing and its correct.


You are right Nayan.. I am   not getting the alert message at all.. I m not sure, why am I not getting..


Write Alert before If Condition and check what value you are getting.



alert(caller.u_state);