You need to sign in to do that
Don't have an account?
Tom S
Case with nested if statements
To preface my question I"m a newbie so please be patient with me I'm very new to Salesforce.
I need to populate a text field called "Account Folder Name" with one of these values Agent, Carrier, Individual, Support, Client, Prospect or Former Client. The result of this field will be used to create our folder structure in Egnyte.
My challenge is under the field "BenefitsGuide__RecordTypeName__c" I have two options "Account_Large_Group" and "AccountSmallGroup" that need to be broken down into "Client" or "Prospect" or "Former Client". I have looked everywhere and the best I came up with is the following...
CASE(BenefitsGuide__RecordTypeName__c,
"Account_Broker_Agent", "Agent",
"Account_Brokerage_Agency", "Agent",
"Account_Carrier", "Carrier",
"Account_Groups_of_1", "Individual",
"Account_Individual_Family", "Individual",
"AccountSupport", "Support",
"Account_Large_Group",
IF(Egnyte_Group_Type__c = "Client", "Client",
IF(Egnyte_Group_Type__c = "Prospect", "Prospect",
IF(Egnyte_Group_Type__c = "Former Client", "Former Client", "")))
"AccountSmallGroup",
IF(Egnyte_Group_Type__c = "Client", "Client",
IF(Egnyte_Group_Type__c = "Prospect", "Prospect",
IF(Egnyte_Group_Type__c = "Former Client", "Former Client", "")))
"General"))
My problem is I can't figure out how to get past the syntax error missing ')' so any help will be appreciated. Oh and "Egnyte_Group_Type__c" is a text field I am pulling data into from a picklist field. If needed I can use the picklist field directly its name is "BenefitsGuide__Account_Status__c".
Thanks
I need to populate a text field called "Account Folder Name" with one of these values Agent, Carrier, Individual, Support, Client, Prospect or Former Client. The result of this field will be used to create our folder structure in Egnyte.
My challenge is under the field "BenefitsGuide__RecordTypeName__c" I have two options "Account_Large_Group" and "AccountSmallGroup" that need to be broken down into "Client" or "Prospect" or "Former Client". I have looked everywhere and the best I came up with is the following...
CASE(BenefitsGuide__RecordTypeName__c,
"Account_Broker_Agent", "Agent",
"Account_Brokerage_Agency", "Agent",
"Account_Carrier", "Carrier",
"Account_Groups_of_1", "Individual",
"Account_Individual_Family", "Individual",
"AccountSupport", "Support",
"Account_Large_Group",
IF(Egnyte_Group_Type__c = "Client", "Client",
IF(Egnyte_Group_Type__c = "Prospect", "Prospect",
IF(Egnyte_Group_Type__c = "Former Client", "Former Client", "")))
"AccountSmallGroup",
IF(Egnyte_Group_Type__c = "Client", "Client",
IF(Egnyte_Group_Type__c = "Prospect", "Prospect",
IF(Egnyte_Group_Type__c = "Former Client", "Former Client", "")))
"General"))
My problem is I can't figure out how to get past the syntax error missing ')' so any help will be appreciated. Oh and "Egnyte_Group_Type__c" is a text field I am pulling data into from a picklist field. If needed I can use the picklist field directly its name is "BenefitsGuide__Account_Status__c".
Thanks
Something like this:
CASE(BenefitsGuide__RecordTypeName__c,
"Account_Broker_Agent", "Agent",
"Account_Brokerage_Agency", "Agent",
"Account_Carrier", "Carrier",
"Account_Groups_of_1", "Individual",
"Account_Individual_Family", "Individual",
"AccountSupport", "Support",
"Account_Large_Group",
IF(Egnyte_Group_Type__c = "Client", "Client",
IF(Egnyte_Group_Type__c = "Prospect", "Prospect",
IF(Egnyte_Group_Type__c = "Former Client", "Former Client", ""))),
"AccountSmallGroup",
IF(Egnyte_Group_Type__c = "Client", "Client",
IF(Egnyte_Group_Type__c = "Prospect", "Prospect",
IF(Egnyte_Group_Type__c = "Former Client", "Former Client", ""))),
"General")
If it helps please like and mark as correct, it may help others.
Good luck.
All Answers
Something like this:
CASE(BenefitsGuide__RecordTypeName__c,
"Account_Broker_Agent", "Agent",
"Account_Brokerage_Agency", "Agent",
"Account_Carrier", "Carrier",
"Account_Groups_of_1", "Individual",
"Account_Individual_Family", "Individual",
"AccountSupport", "Support",
"Account_Large_Group",
IF(Egnyte_Group_Type__c = "Client", "Client",
IF(Egnyte_Group_Type__c = "Prospect", "Prospect",
IF(Egnyte_Group_Type__c = "Former Client", "Former Client", ""))),
"AccountSmallGroup",
IF(Egnyte_Group_Type__c = "Client", "Client",
IF(Egnyte_Group_Type__c = "Prospect", "Prospect",
IF(Egnyte_Group_Type__c = "Former Client", "Former Client", ""))),
"General")
If it helps please like and mark as correct, it may help others.
Good luck.