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

yes Harsha, Correct

so In which case , its failing ? 

it is failing at Change approval records approve.

if planned start date and End date empty then Approval records should NOT be approve. 

I am assuming you have used business rule for this, if yes please paste your update business rule script here 

Hi Harsha,

is my script has any issue ?

var gr = new GlideRecord('change_request');
gr.addQuery('sys_id', current.sysapproval);
gr.addQuery('state',-3)
gr.query();
while(gr.next()) {

gr.addEncodedQuery('active=true^type=normal^start_dateISNOTEMPTY^end_dateISNOTEMPTY');

gr.query();

if(gr.next()){
gs.log('Dates updated');
} else {
gs.addErrorMessage("Please fill Planned Start Date/ End Date");
current.setAbortAction(true);
}

}