I need to calculate a new due date based on the creation date to be displayed on the form as a computed field but I have to exclude the weekends.Can someone help me with the code.
This code is with weekend what do I have to do to exclude weekends?
take a look at @BusinessDays. If I understand your requirement, in your example you want to extend the due date by 14 business days, correct? So find out the number of business days then subtract that from 14 then add the remainder to 14 to get the date that represents 14 business days. will you also need to account for holidays?
Subject: RE: Calculate new date excluding weekends
it gets a bit tricky because when you find a non business day you have to increase your increment. here’s an example but you need to hard code your holidays. I’ve inserted 2 holidays, even though they are not real, just to demonstrate. Paste this code into a button: