Show custom fields if On Hold reason was Awaiting vendor during Incident Cycle

SNOW learner
Mega Contributor

I have created four fields on Incident Form (Vendor Name, Vendor Ticket No, Vendor Start Time & Vendor End time) which should be mandatory when On Hold status is "Awaiting Vendor".

Also if these fields should be visible if during Incident Cycle On hold reason was "Awaiting vendor" else it should be hidden.

Example:

1. If during incident cycle on hold reason was not Awaiting Vendor then this field should not be visible on the form.

2. However in case of Incident state changed from In progress --> On hold with reason "Awaiting Vendor" --> In progress --> On Hold with reason any other option --> In progress --> Resolved ; in this case Vendor related fields should be visible on form.

3. In case Incident state changed from In progress --> On hold with reason "Awaiting Vendor" --> In progress --> Resolved ; in this case Vendor related fields should be visible on form.

4. In case of Incident state changed from In progress --> On Hold with reason any other option --> In progress --> On hold with reason "Awaiting Vendor" --> In progress --> Resolved ; in this case Vendor related fields should be visible on form.

Please help with a solution.

1 ACCEPTED SOLUTION

On your business rule try changing your 'When' field to 'Before', your 'Condition' field to 'On hold reason' changesTo 'Awaiting vendor'.  Then change your script line to this...

current.u_vendor = true;

View solution in original post

5 REPLIES 5

Mark Stanger
Giga Sage

The only way to do this would be to create a new checkbox field (maybe 'Vendor') that gets set to true when 'Awaiting vendor' is initially selected.  I would probably do this in a business rule.  Then you could set up your UI policy to show/hide your vendor-related fields based on the new checkbox.  Then your state could change independent of the vendor fields.

Thanks Mark, Look good way to achieve this. I have created a checkbox field "Vendor" however I tried via below Business rules but it's not working, attached screen shot for reference:

I tried with below Client scripts as well, unfortunately this is also not working. Screen shot for reference:

Any suggestions.

On your business rule try changing your 'When' field to 'Before', your 'Condition' field to 'On hold reason' changesTo 'Awaiting vendor'.  Then change your script line to this...

current.u_vendor = true;

Prefect. It's working. Thanks for your quick response.