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
scottyscotty 

Populate date based on checkbox

I need to havea date populate based on a check box being populated.  The key is that it needs to be based on the create date of a lead, but also have the date revert back to null when the check box is unchecked.  I have a formul that I started that works partialy for the population of the date field but i have not attempted to start with making the date blank when the checkbox is unchecked. This is in the group edition.

 

if(AND(  Subscription_Status_Trial__c  , CreatedDate =NOW()),TODAY(),NULL)

Best Answer chosen by Admin (Salesforce Developers) 
Jeff MayJeff May

The field will be null anytime the condition is false (in this case, unchecked).  To use a date offset from the created date, Just do CreatedDate + 60 in the formula.

All Answers

Jeff MayJeff May

Your formula is very close.  Nice job.

 

Assuming your Date field is "myDate", the following will show the CreatedDate when Subscription_Status_Trial__c is checked, and null when it is unchecked.

 

if(Subscription_Status_Trial__c, CreatedDate, NULL)

scottyscotty
Two questions:

1. If i wanted to pas the date at + 60 days what needs to change?
2. If i uncheck the box will the date revert to null?
Jeff MayJeff May

The field will be null anytime the condition is false (in this case, unchecked).  To use a date offset from the created date, Just do CreatedDate + 60 in the formula.

This was selected as the best answer