How to get alert/warning message (alert message) when manager approves after planned start date

Vinod S Patil
Tera Contributor

Hello Everyone,

I have below requirements, please suggest me

> Create warning message when manager approves after planed start date/time.

 

 

@Sandeep Rajput 

@Satishkumar B 
@Mark Manders 

@

5 REPLIES 5

Mark Manders
Mega Patron

Please don't tag people in questions!


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Satishkumar B
Giga Sage
Giga Sage

@Vinod S Patil use g_form. addErrorMessage('message');

 

…………………………………………........................................................................................
Please Mark it helpful 👍and Accept Solution !! If this helps you to understand.

…………………………………………........................................................................................

@Satishkumar B  
 g_form. addErrorMessage('message'); it will be in the loop but before that what condition we need to add in client script.

@Vinod S Patil Try BR

if (current.approval == 'approved' && new GlideDateTime().getNumericValue() > new GlideDateTime(current.planned_start).getNumericValue()) {
gs.addErrorMessage('Warning: The approval is after the planned start date/time.');
current.setAbortAction(true); // Prevents the approval from proceeding
}