I want to write the pop warning when problem task is not complete

PRAGHATIESH S
Tera Expert

In the problem record RCA state should not move Fix in progress when Problem task is not completed. I want the pop waring using business rule.

 

 

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @PRAGHATIESH S 

 

Check this OOTB Prb properties:

 

LearnNGrowAtul_0-1707739855449.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

swathisarang98
Giga Sage

Hi @PRAGHATIESH S ,

 

Could you please elaborate more on the requirement like what you want to show in the pop up message and on what condition ?

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

Maddysunil
Kilo Sage

@PRAGHATIESH S 

You can use below script in your business rule

(function executeRule(current, previous /*null when async*/) {
    // Check the condition: RCA state is 'Fix in Progress' and Problem task state is not 'Closed'
    if (current.state == 'Fix in Progress' && current.problem_task.state != 'Closed') {
        // Display a warning message
        gs.addErrorMessage("Cannot move RCA state to 'Fix in Progress' when the Problem task is not completed.");
        
        // Prevent the record from being saved
        current.setAbortAction(true);
    }
})(current, previous);

 Please mark my answer correct/Helpful if it helps.