Is it possible to avoid editing a Form from Service Catalog and Unified Self-Service for a request which is already closed?

Document ID : KB000013693
Last Modified Date : 14/02/2018
Show Technical Document Details
Question:

Is it possible to avoid editing a Form from Service Catalog and Unified Self-Service for a request which is already closed?

How to disable a form based on the request status?

Environment:
Service Catalog 14.1Unified Self-Service 14.1
Answer:

If you do want to hide or disable the entire form according to the request status, the user's role or business unit, or other criteria,

enter the corresponding JavaScript expression in the Hidden or Disabled field.

Use the following format: $(_.object.property). The expression must return a value of true or false.

To set the expression you need to go to:

Catalog > Service Offering > Definition > Edit the Service Option > Select the Form >  Set the value in the disable/Hidden field. No need to add it on every form.

You can specify a JavaScript expression in the Hidden field, the Disabled field, or both.

For instructions to specify a JavaScript expression correctly, see Use JavaScript Expressions in Fields in the link noted in the Additional Information section below.

That section explains how to specify expressions in fields within a form; those instructions also apply to any expressions that you specify for the entire form in the Disabled and Hidden fields in this step.

Examples follow:

To hide or disable the form when the request status is Pending Approval, enter the following JavaScript expression in the Hidden or Disabled field: $(_.request.status == 400).

To hide or disable the form for end user roles only, enter $(_.user.role == ‘enduser’).

To hide or disable the form from all business units except ca.com, enter $(_.bu.id != ‘ca.com’).

To disable the form when the request status is Fulfilled, enter $(_.request.status == 2000).

Note: When an entire form is disabled, it is disabled but visible during all stages of the request life cycle except check-out.

During check-out, a disabled form is both disabled and hidden.

Additional Information: