How to make Planned start date/End Date as mandatory in Change request

Sironi
Kilo Sage

Hi,

Some one plese help me on below issue.

How to make  Planned StartDate / Planned EndDate fields Mandatory when we click on "Request Approval " Button 

OR

when we try to approve Change request Operation must be Abort and give warning message like fill Planned StartDate/Enddate don't empty.

find_real_file.png

 

OR

find_real_file.png

1 ACCEPTED SOLUTION

try now

 

var gr = new GlideRecord('change_request');
gr.get('sys_id', current.sysapproval);
gs.log('planned start '+ gr.start_date +' == '+  gr.end_date);
if(gr.start_date =='' && gr.end_date==''){
gs.addErrorMessage("Please fill Planned Start Date/ End Date");
current.setAbortAction(true);
}

View solution in original post

22 REPLIES 22

try now

 

var gr = new GlideRecord('change_request');
gr.get('sys_id', current.sysapproval);
gs.log('planned start '+ gr.start_date +' == '+  gr.end_date);
if(gr.start_date =='' && gr.end_date==''){
gs.addErrorMessage("Please fill Planned Start Date/ End Date");
current.setAbortAction(true);
}

Hi Harsha,

it is working

can we remove that info message one"Approved Change Request: CHG0030084"

find_real_file.png

What are you getting in logs? how are you testing it ? 

Note: On change request if planned start data AND planned end date will be empty this will not allow you to do further action on approval record. 

it is working

it is working

can we remove that info message one"Approved Change Request: CHG0030084"

find_real_file.png

Glad it worked,

Kindly smash the helpful and correct button. 

To hide that message you can either find the source of script to check why its appearing and then you can include some logic there to only show on some certain case. 

you can try with gs.flushMessages(); in your business rule