Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Record is being aborted on update but there is no abort BR on the same table. How it is possible?

Anil Nemmikanti
Tera Guru
Tera Guru

Record is being aborted on update but there is no abort BR on the same table. But there is BR on different table which is not linked to the table. How it is possible?

13 REPLIES 13

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

	if(current.start_date_time.nil() || current.end_date_time.nil()) {
		gs.addErrorMessage(gs.getMessage("The dates and times you entered were not valid"));
		current.setAbortAction(true);
		return;
	}

	var startMs = current.start_date_time.getGlideObject().getMS();
	var endMs = current.end_date_time.getGlideObject().getMS();
	
	if (endMs < startMs) {
		current.setAbortAction(true);
		gs.addErrorMessage(gs.getMessage('End date time cannot be before start date time'));
	}

})(current, previous);

 

Yes the same date time fields are there on span table as well and one of the fields is getting emptied out while updating, as per the script if any of the field is empty it will abort the update.

@Anil Nemmikanti 

I couldn't find 'user_calendar_event" table in my PDI

AnkurBawiskar_0-1763037014893.png

 

what happens if you deactivate that BR?

are you allowed to save?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I haven't tried and am not allowed to update the OOTB things. 

 

Appreciate your time. Thanks.

@Anil Nemmikanti 

if it's DEV then no harm in updating the OOTB BR

Unless you do that how will you debug?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader