Chevron should indicate as checked for the state that has been skipped

user_lm
Tera Contributor

We can transition the state directly to 'Qualified' after submission bypassing the 'Screen' state in Demand . In this case, the chevron should indicate that the screening has already been checked. Can some one help me in making Screen as checked in chevron.

 

Thanks in Advance

 

1 REPLY 1

sumanta pal
Kilo Guru

Sure, you can achieve this by using a Business Rule in ServiceNow. Here are the steps:

1. Navigate to System Definition > Business Rules.
2. Click on New to create a new Business Rule.
3. Give your Business Rule a name, for example, "Bypass Screen State".
4. In the 'When to run' section, select 'After' as the 'When' and 'Insert' as the 'Action'.
5. In the 'Table' field, select 'Demand'.
6. In the 'Advanced' tab, write a script to set the state to 'Qualified' and the 'Screen' state as checked. Here is a sample script:

javascript
(function executeRule(current, previous /*null when async*/) {
if (current.state == 'Screen') {
current.state = 'Qualified';
current.u_screen_checked = true; // Assuming 'u_screen_checked' is the field for 'Screen' state checked
}
})(current, previous);


7. Click on 'Submit' to save the Business Rule.

Please note that the above script is a sample script and you may need to adjust it according to your actual field names and requirements. Also, this will bypass the 'Screen' state for all demands. If you want to apply this only for specific demands, you need to add appropriate conditions in the script.

Remember to test this in a sub-production instance before applying it to your production instance.