function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
brooksbrooks 

"field does not exist" error message . . .

Hi.

I have a simple custom formula:

IF( (LEN( Fund)=0), "None",
IF(CONTAINS( "1203", Fund), "Retail Fund",
IF(CONTAINS( "1204", Fund), "Industry Fund",
IF(CONTAINS( "1205", Fund), "Value Fund"))))

And when I check the syntax I'm getting this error message:

"Field Fund does not exist. Check spelling."

The field "Fund" does exist, so I'm wondering what the issue is.

Thanks,
Brooks
SuperfellSuperfell
the name of the Fund field is likely to be Fund__c not Fund
brooksbrooks
Thanks for replying.

I thought that might be the problem as well, so I made the switch to Fund_c like so:

IF( (LEN( Fund_c)=0), "None",
IF(CONTAINS( "1203", Fund_c), "Retail Fund",
IF(CONTAINS( "1204", Fund_c), "Industry Fund",
IF(CONTAINS( "1205", Fund_c), "Value Fund"))))

But I still get:

Error: Field Fund_c does not exist. Check spelling.

I'm sure this is something stupid . . .
brooksbrooks
"Fund" is a text field and my custom formula field, which I'm calling "Fund Name," is also a text field. Do I need to make "Fund" a number field?
WesGrayWesGray
It is Fund__c with 2 underscores.
brooksbrooks
Ah, thanks. That works.

However, getting this syntax error now . . . what am I doing wrong? Am I closing the last IF statement incorrectly?

IF( (LEN( Fund__c)=0), "None",
IF(CONTAINS( "1203", Fund__c), "Retail Fund",
IF(CONTAINS( "1204", Fund__c), "Industry Fund",
IF(CONTAINS( "1205", Fund__c), "Value Fund"))))

Error: Incorrect number of parameters for function IF(). Expected 3, received 2
WesGrayWesGray
Your final If statement only has 2 parameters.  Indenting your code makes it clearer:

IF(LEN( Fund__c)=0, "None",
    IF(CONTAINS("1203", Fund__c), "Retail Fund",
        IF(CONTAINS("1204", Fund__c), "Industry Fund",
            IF(CONTAINS("1205", Fund__c), "Value Fund", "NEED SOMETHING HERE")
        )
    )
)

brooksbrooks
Got it.

I didn't realize CONTAINS needed a value to return if the previous arguments were false.

Thanks for the help.