You need to sign in to do that
Don't have an account?
Problem with Syntax
Hi, I am very new to formulas and SF and can't seem to get SF syntac right. I keep getting errors on this formula. I would really appreciate some help!
If ((RecordType.Id), ("012E0000000MoYF") || ( RecordType.Id), ("012E0000000Mu8O") || ( RecordType.Id), ("012E0000000MoYN") || ( RecordType.Id), ("012E0000000MoYQ")),
( IF(ISPICKVAL(npe01__PreferredPhone__c, "Home"), HomePhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Other"), OtherPhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Work"), npe01__WorkPhone__c,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Mobile"), MobilePhone, Account.Phone
),
( IF(ISPICKVAL(npe01__PreferredPhone__c, "Home"), HomePhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Other"), OtherPhone,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Work"), npe01__WorkPhone__c,
IF(ISPICKVAL(npe01__PreferredPhone__c, "Mobile"), MobilePhone, Employer_Number__c
)
Let me see if I can restate the requirements:
If this is correct, I think you can simplify this quite a bit like this:
How it works:
If I got the requirements wrong there, please explain further what you're trying to do and we'll see if we can help you out.
All Answers
If ((RecordType.Id), ("012E0000000MoYF") || ( RecordType.Id), ("012E0000000Mu8O") || ( RecordType.Id), ("012E0000000MoYN") || ( RecordType.Id), ("012E0000000MoYQ"))
You never compared values.
Proper syntax would be
IF(RecordType.Id == '012E0000000MoYF','return value1','return value2')
Also, are all of those IF statements "AND's or OR'S".
We need more information to figure out how it should be.
Let me see if I can restate the requirements:
If this is correct, I think you can simplify this quite a bit like this:
How it works:
If I got the requirements wrong there, please explain further what you're trying to do and we'll see if we can help you out.
You are a genius. This is exactly what I was trying to do. Works like a charm. Bless you.