- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2021 02:18 PM
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.
OR
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 02:03 PM
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);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 02:03 PM
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 02:27 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 02:30 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 02:33 PM
it is working
it is working
can we remove that info message one"Approved Change Request: CHG0030084"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 02:36 PM
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