Set the Follow up date based on due date in Task table

Roshni1
Tera Expert

My client's requirement is that once the due date field is populated based on Employee start date that the follow up date field gets updated with the same date.  

 

I am seeing allot of help on adding dates but I need to just have them match the due date. 

This is the script I found but its not working:

(function executeRule(current, previous /*null when async*/) {
    if (current.due_date && !current.follow_up_date) {
        var followUp = new GlideDateTime(current.due_date);
        followUp.addDays(0); // Add 2 days (or any desired amount)
        current.follow_up_date = followUp;
    }
})(current, previous);

 

Any assistance would be appreciated 

Thank you

4 REPLIES 4

KrishnaMohan
Giga Sage

Hi @Roshni1 

 

What  type of business rule are you using after or before? 

 

Regards,
Krishnamohan

 

Hi Krishnamohan 

 

Here is what I have 

Roshni1_0-1749226075633.png

 

Bert_c1
Kilo Patron

try changing

        followUp.addDays(0); // Add 2 days (or any desired amount)

to:

        followUp.addDays(2); // Add 2 days (or any desired amount)

thanks but I am trying to have the same date that is in Due Date not a calculated date based on 2 or more days.