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
JaxBeachJaxBeach 

Help with CreateDate in Formula

Hi,

 

I have a formula that makes a field required if certain requirements are met.  I found out that it is effecting older cases where this new field wasn't active yet.

 

How do I put a qualifier on the formula so that it only applies to cases created after 6/30/2103?

 

My formula is

 

AND(ISPICKVAL( Product_Category__c , "Defense Technology"), TEXT(Order_Contains_ATF_Items__c)="") && $RecordType.Name = "Customer Care" &&  ISPICKVAL(Case_Type__c , "Place an Order") && ISPICKVAL(Status, "Closed")&& CreateDate < 2013-06-30T00:00:00.000Z

 

My error message states Error: Syntax error. Extra T00:00:00.000Z

 

 

Thanks. :)

Best Answer chosen by Admin (Salesforce Developers) 
Rahul_sgRahul_sg
try this
CreatedDate < DATETIMEVALUE( DATE(2013, 6, 30))

All Answers

Rahul_sgRahul_sg
try
CreateDate < DATE(2013, 6, 30)
JaxBeachJaxBeach

Thanks.  I tried it but I get an error message that states

 

Error: incorrect parameter type for operator '<' Expected DateTime, received Date.

Justine HeritageJustine Heritage

Did you mean to use CreatedDate instead of CreateDate? CreatedDate is a date/time field. If not, use DATETIMEVALUE() to convert a date type to a date/time.

JaxBeachJaxBeach

I used CreateDate first but then it said there was no such field.

 

I used CreatedDate in my original formula post - what would I do different to not get the posted error?

Rahul_sgRahul_sg
try this
CreatedDate < DATETIMEVALUE( DATE(2013, 6, 30))
This was selected as the best answer
JaxBeachJaxBeach

Thank you so much - it worked! :)