- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
10-31-2012 09:23 AM
Need a bit of help this morning. I am trying to create a formula that will generate a task one year after the "Effective Date" (Type: Date) of the record.
I tried using this formula that I found posted on this board but I get the error message that "Error: Formula result is data type (Date), incompatible with expected data type (true or false)"
YEAR ( Effective_Date__c ) + (FLOOR((TODAY() - Effective_Date__c) / 365) + 1),
IF(AND(DAY(Effective_Date__c) = 29,MONTH(Effective_Date__c ) = 02) , 28, DAY(Effective_Date__c)))
Solved! Go to Solution.
10-31-2012 10:21 AM
Are you using EE or UE? Are you using a workflow rule or trying to do this somehow using a formula field?
Also, do you want the Task to be assigned and DUE a year from Effective Date or do you just want it created a year later? I am assuming this is a task that is due a year later and not necessarily assigned a year later.
The correct way to do this would be to create a workflow rule on the object which the Effective Date field is on.
Evaluation Criteria: created, and any time it’s edited to subsequently meet criteria
Run Criteria: Effective Date is not equal to __________ [blank]
Workflow Action (New Task): Set the Due Date to Effective Date + 365 Days