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
Blake Carrera 4Blake Carrera 4 

Set date field through formula for July 1 of next year

I currently have a requirement where I need to set up a workflow or process. When an Opportunity is marked as Closed Won, a custom date field on that Opportunity (Renewal_Date__c) should populate as 7/1/20xx (whatever the next year is). 

Does anyone have any hints as to the formula I should use here?
Best Answer chosen by Blake Carrera 4
Sunil RathoreSunil Rathore
Hi,

Greeting to you!!

You can use the below formula:
DATE(YEAR(TODAY())+1,7,1)

This formula will update the year value as next year of the current year and month value as 7(i.e.July) and day value as 1.

Let me know if it suffice your requirement. If yes, then mark it as the best answer so it can also help others in the future.


Many Thanks,
Sunil Rathore

All Answers

Andrew GAndrew G
Try something simple like:

DATE( YEAR(DATEVALUE( ClosedWonDateTime )) + 1,07,01)

so 1/13/2019 ---> 7/1/2020 
so 7/13/2019 ---> 7/1/2020 
logic is adding 1 year to the date, so we get to next year only - means renewal could be between 18 and 6 months away

or 

DATE( YEAR(DATEVALUE( ClosedWonDateTime + 185 )),07,01)
so 1/13/2019 ---> 7/1/2019 
so 7/13/2019 ---> 7/1/2020 

logic is adding 185 days to the date, so we get to next year where the close date is in the second half of the year, so renewal is no more than 1 year away, but could be as short as 1 week , where the renewal is to happen at the end of the FY 

You could do a process builder and do a field update using one of the above, or some variation depending on the exact rules for the renewal.

Regards
Andrew
Sunil RathoreSunil Rathore
Hi,

Greeting to you!!

You can use the below formula:
DATE(YEAR(TODAY())+1,7,1)

This formula will update the year value as next year of the current year and month value as 7(i.e.July) and day value as 1.

Let me know if it suffice your requirement. If yes, then mark it as the best answer so it can also help others in the future.


Many Thanks,
Sunil Rathore
This was selected as the best answer
Thomas Brown 28Thomas Brown 28
Wow, thanks, I'll use it for my college-paper.org reviews (http://essay-reviewer.com/college-paper-org-review/) site. 
nikon kafenikon kafe
Customer Feedbacks. What Customers Say about Voicebuy. Dear Visitor, Voicebuy is happy to have you on board! We are always striving to improve the quality ...
https://customerfeedbacks.info/