How to make Catalog Item variables read-only based on UTC business hours in Employee Center?

Sirri
Kilo Sage

Hi Team,

I have a requirement for a ServiceNow Catalog Item in Employee Center.

The requirement is:

  • During 9:00 AM to 6:00 PM Riyadh time, users should not be allowed to submit the Catalog Item.
  • This is equivalent to 6:00 AM to 3:00 PM UTC.
  • During this time window, I want to make the Catalog Item variables read-only and prevent users from submitting the request.
  • Outside this time window, the variables should remain editable and users should be able to submit the request.

    How I can achieve this requirement Please someone provide the entire code that will help full to me.

    Below are fields only available in that catalog item & I need to showcase error message:
      g_form.setReadOnly('requester', true);
                g_form.setReadOnly('requested_for', true);
                g_form.setReadOnly('justification', true);
                g_form.addErrorMessage('This request cannot be submitted between 9:00 AM and 6:00 PM Riyadh time.');


    Thank you.
0 REPLIES 0