Normal Change Planned start date

Community Alums
Not applicable

For a Normal CHG, we want to update the logic so that the CHG cannot be planned to start before the next CAB meeting. CAB meetings are currently set to occur on Wednesdays. For example, if I were to create a new Normal CHG on Thursday 11/30/2023, the Planned Start Date must be Wednesday 12/6/2023 2:30 PM Pacific or later, since that is when the next CAB meeting will have ended. (I’m thinking you will need to write a client script on the CHG form to make this work.)

Please help me on this.

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Community Alums 

 

To do this part

1st try a BR to auto populate the CAB Date in change for as soon as user submit the change. and keep this field read only. 

After this , add validation if plan start date is less than CAB date then user will get error message.

*************************************************************************************************************
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]

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

SunilKumar_P
Giga Sage

Hi @Community Alums, Can you try the before update business rule as below?

 

Script:

 

(function executeRule(current, previous /*null when async*/ ) {

    var gdt1 = new GlideDateTime(current.cab_date_time);
    var gdt2 = new GlideDateTime(current.start_date);
    if (gdt2.before(gdt1)) { // Date time selected in past
        gs.addErrorMessage("Planned start date cannot be before CAB date.");
        current.start_date = '';
        current.setAbortAction(true);
    }

})(current, previous);
 
SunilKumar_P_0-1702908777424.pngSunilKumar_P_0-1702908860869.png

 

Regards,

Sunil