0

The title says it all. I know I am missing my 3rd parameter per the error, but I can't determine where.

IF ( Not_Final_Destination__c = TRUE,

  IF (AND(SCMC__Customer_Account__r.ShippingCountry <> "United States", 
      SCMC__Customer_Account__r.ShippingCountry <> "Canada"), 
    SCMC__Customer_Account__r.ShippingCountry,

    IF (OR(SCMC__Customer_Account__r.ShippingCountry = "United States", 
        SCMC__Customer_Account__r.ShippingCountry = "Canada"), 
      SCMC__Customer_Account__r.ShippingState,

      IF (AND(SCMC__Drop_Ship__c = TRUE, Not_Final_Destination__c = FALSE), 
        SCMC__Drop_Ship_State_Province__c,
  
        IF ((ISBLANK( SCMC__Actual_Ship_To_Address__c )), 
          SCMC__Customer_Account__r.ShippingState, 
          SCMC__Actual_Ship_To_Address__r.SCMC__Mailing_State_Province__c)
        )
      )
  )
)
1
  • 1
    Formatting formulas as if they were code (one "statement" per line, indent another level for each nested function), as Felix has done for you, really helps to make issues like this more visible. It should be everyone's first step to take when debugging formulas. It won't show up unless you get to the edit page for the formula, but even copy/pasting it into notepad and indenting can be helpful.
    – Derek F
    Commented Feb 22, 2022 at 13:17

1 Answer 1

0

In the first IF() condition you kept the all the formula when that is true. But did not mention the value it should return for the false condition.

 IF ( Not_Final_Destination__c = TRUE,
    
    IF (AND(SCMC__Customer_Account__r.ShippingCountry <> "United States", SCMC__Customer_Account__r.ShippingCountry <> "Canada"), SCMC__Customer_Account__r.ShippingCountry,
    
    IF (OR(SCMC__Customer_Account__r.ShippingCountry = "United States", SCMC__Customer_Account__r.ShippingCountry = "Canada"), SCMC__Customer_Account__r.ShippingState,
    
    IF (AND(SCMC__Drop_Ship__c = TRUE, Not_Final_Destination__c = FALSE), SCMC__Drop_Ship_State_Province__c,
    
    IF ((ISBLANK( SCMC__Actual_Ship_To_Address__c )), SCMC__Customer_Account__r.ShippingState, SCMC__Actual_Ship_To_Address__r.SCMC__Mailing_State_Province__c) ) ) ), 
**ADD the value what should it return for the first false condition**)
1
  • This helped. I ended up rewriting it and realized where I was missing my paraemeter. Thanks! Commented Feb 22, 2022 at 17:46

You must log in to answer this question.

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