0

I want to create a formula for a particular opportunity record type, comparing two date fields and returning one of two variations on a pick list. I've tried variations on the below formula but can't seem to reach the correct conclusion: -

IF( AND(RecordType.Name = "Domestic Opportunity", 
        Created_Date__c <=  Account.Last_Sale__c), 
        StageName = "Closed Won",
        "Passed to Depot")

Any assistance would be very much appreciated.

2
  • What are you trying to achieve, are you trying to update the StageName field when certain criteria are met? Commented Aug 15, 2014 at 15:00
  • formula as written makes no sense -- the true outcome of the IF shouldn't be an assignment statement
    – cropredy
    Commented Aug 15, 2014 at 22:04

2 Answers 2

1

I'm not entirely sure what you're trying to achieve. Is this a text formula that should return Closed Won / Passed to Depot based on the date comparison?

If so, try:

If (
    And (
        RecordType.Name = 'Domestic Opportunity',
        Created_Date__c <=  Account.Last_Sale__c
    ),
    'Closed Won',
    'Passed to Depot'
)
2
  • Hi and thanks. Closed won and passed to depot are pick-list options on the opportunity Stage field, so this won't work. Commented Aug 15, 2014 at 15:30
  • You need to give us more information. It sounds like you want Opportunity.StageName to be updated back on the value of the date fields? For that you will need a workflow, not a formula as formula cannot edit the values of other fields. Commented Aug 15, 2014 at 15:34
1

You would need to put the record type condition first and then nest the 2nd condition,

If(RecordType.Name = 'Domestic Opportunity',
  If(Created_Date__c <= Account.Last_Sale__c, 'Closed Won', 'Passed to Depot'),
    '')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .