logo

NJP

Add number of days in the Due Date field/Custom field using Business Rules

Import · Aug 05, 2022 · article

I have explained how we can add 7 days in the Due Date field/Custom field using Business Rules in ServiceNow.

If you have any feedback related to the scripting part, please write it in the comment box.

==================BUSINESS RULES====================

Table - Requested ItemWhen to Run - Before and on InsertScripts -

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

// Add your code here var gd = new GlideDate(); gd.addDays(7);

current.u_estimated_time_of_delivery = gd;

var gdt = new GlideDateTime(); gdt.addDays(7);

current.due_date = gdt;

})(current, previous);

Best Regards,

Prashant

If my article helped you in any way, please mark this as helpful and make this a bookmark.

Labels:

image

View original source

https://www.servicenow.com/community/developer-articles/add-number-of-days-in-the-due-date-field-custom-field-using/ta-p/2302934