You need to sign in to do that
Don't have an account?
degmo
Date formula help
Hi,
I have two custom date fields on the account object. Signup_Date and Contact_Date. The requirement I have says, if the Signup_Date is greater than 45 calendar days from today, I need to make sure the Contact_Date is Signup_Date minus 45 calendar days. One important caveat is I have to make sure that Signup_Date minus 45 calendar day doesn't fall on a weekend. If it falls on Saturday, I need to set it to the Friday before and if it is on a Sunday, i need to set it to the Monday after. I am struggling with this and hoping somebody can assist me.
I have two custom date fields on the account object. Signup_Date and Contact_Date. The requirement I have says, if the Signup_Date is greater than 45 calendar days from today, I need to make sure the Contact_Date is Signup_Date minus 45 calendar days. One important caveat is I have to make sure that Signup_Date minus 45 calendar day doesn't fall on a weekend. If it falls on Saturday, I need to set it to the Friday before and if it is on a Sunday, i need to set it to the Monday after. I am struggling with this and hoping somebody can assist me.
I think you can have a trigger that works on before insert and you can make use of below code and modify it as per your use case.
reference: https://salesforce.stackexchange.com/questions/91916/subtract-date-days-from-number-except-weekend-days-using-apex-class
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.