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
SFDafSFDaf 

Date Formula

I'm trying to get a field to auto update based on a date field.

 

If the Close date = 6/14/2013 

then new custom field  = 7/1/2013

 

Basically if any date falls in the month of june, i.e. 6/2/2013, 6/28/2013, 6/16/2013, the new custom field updates to 7/1/2013.

 

Would that be a workflow rule with a field update or can it be a field formula? Any help is appreciated. Thanks!

Sonam_SFDCSonam_SFDC

Hi,

 

You can create a formula field with the following formula for custom field value:

Generalized for every date : DATE(YEAR(Close_Date__c),MONTH(Close_Date__c)+ 1,1)

 

Try and let me know if this meets your requirement.

 

 

Justine HeritageJustine Heritage

You also need to check if the month is December because adding one to December will result in an invalid date.

 

IF(

    MONTH(Close_Date_c) = 12,

    DATE( YEAR(Close_Date_c) + 1, 1, 1),

    DATE( YEAR( Close_Date_c), MONTH(Close_Date_c) + 1, 1)

)