1

I want to use the value of the account custom text field named Id__c, in a custom link on the account object. I want the custom link to go to two different pages depending on if there's a value in the Id__c field or not.

My formula looks like this:

{!IF(
    ISBLANK( Account.Id__c ),
    URLFOR("http://isBlank.com", null),
    URLFOR("http://isNotBlank.com/" & Account.Id__c, null)
)}


/* I'm using the URLFOR() function in order for the URL returned by the function to be properly encoded */

If the Id__c field is blank, I would expect the link to go to http://isBlank.com, however upon testing:

As you can see, the ISBLANK() function is always returning false, since if the 'Account.Id__c' field value is actually blank, the function appears to be evaluating the 'Account.Id' value instead, which can never be blank. Either way, it's always evaluating a non-blank value.

I simplified the formula for testing, to just the following:

http://example.com/{!Account.Id__c}

Is this is a bug? How can I workaround this issue to effectively test for a blank value in my Id__c field?

Here's some screenshots showing the issue: Custom link formula Showing the value of Id__c is blank Link going to the ID of the record I verified that the field is actually blank using Salesforce Inspector. Salesforce Inspector showing the value of Id__c is truly blank

0

I was not able to figure out why the Id__c reference was incorrectly returning the record Id, but I ended up just handling this eventuality in my formula, assuming that the if Id__c was equal to Id, then it's blank.

My resultant formula was something like:

{!IF(
    Account.Id__c = Account.Id || ISBLANK( Account.Id__c ),
    URLFOR("http://isBlank.com", null),
    URLFOR("http://isNotBlank.com/" & Account.Id__c, null)
)}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.