CA Service Management

Expand all | Collapse all

how to show/hide the form element depends on the status of the request

  • 1.  how to show/hide the form element depends on the status of the request

    Posted May 11, 2017 11:24 AM

    Hi Community,

     

    I have hyperlink from element in service catalog request, I am looking to hide/show this hyperlink form field based on the status of the service request.

    Generally, this form field is in hide by default but when the sc request moved to 'pending fulfillment' status I want this field has to visible. 

    any suggestion on how achieve this?

     

    Thanks,

    Venkat



  • 2.  Re: how to show/hide the form element depends on the status of the request

    Posted May 11, 2017 02:28 PM

    You can invoke a JavaScript function onLoad of your form using the JavaScript expression _.request.status similar to the following:

     

    showLabel:function(){
      if (_.request.status==1000){
        ca_fdShowField(ca_fd.formId,'lbl_5');
      }
    }

     

    You can refer to the following for additional information on JavaScript expressions:

    https://docops.ca.com/ca-service-management/14-1/en/using/service-catalog-management/manage-forms/perform-automated-tasks-in-form-fields/use-javascript-expressions-in-fields