function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mary Perez 1Mary Perez 1 

workflow to update close date to the FIRST Day of the current month

I need help with a WFR for the opporutnity object that will update the Close Date with the first day of the current month and year.

So user enters the Close Date as 2/22/2021 and when saved the Close Date will update to 2/01/2021. I also do not want the Close Date to change when the stage is changed to Closed/Won.

Thank you. 
Best Answer chosen by Mary Perez 1
VinayVinay (Salesforce Developers) 
Hi Mary,

Try below formula.
 
DATE(
     YEAR(TODAY()),
     MONTH(TODAY()),
     1
)
For close date validation rule.
 
AND(ISPICKVAL(Stage, 'Closed/Won'), ISCHANGED(Close Date))

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,

All Answers

VinayVinay (Salesforce Developers) 
Hi Mary,

Try below formula.
 
DATE(
     YEAR(TODAY()),
     MONTH(TODAY()),
     1
)
For close date validation rule.
 
AND(ISPICKVAL(Stage, 'Closed/Won'), ISCHANGED(Close Date))

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
This was selected as the best answer
Mary Perez 1Mary Perez 1
Thank you so much!
Camilla WalkerCamilla Walker

The following will get the first day of the next month for given date field [Date]:
DateTimeAdd( DateTimeAdd([Date],1,"months"), 1 - ToNumber(DateTimeFormat([Date],"%d")),"days")
Basically, it adds one month, then subtracts back based on the day of the month.
Nice answer!! For more instructive informatin, visit  (https://playappcasino.com/mobile-pokies)
Mila CunisMila Cunis
Note that when dates are used as constant values within an expression, they must be represented in the MM/DD/YYYY format. This doesn't mean your spreadsheet data must use dates in this format: the date representation in your spreadsheets is determined by the locale/language of the spreadsheet. ( If you need more information about close dates visit here https://casinowis.com/free-slots-no-deposit )