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
BerettaJonBerettaJon 

Error on my first formula

Hi all,

 

I am trying to build the starter "Recruting Applicaiton" and I am getting this error on my formula.

 

Incorrect parameter for function 'and()'. Expected Boolean, received Text

 

Location__r.City__c && ', ' && Location__r.State_Province__c && ' - ' && Location__r.Country__c

 

I believe I followed the instructions to a T and the mistake is not jumping out at me.  Help?

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

If the datatype for those fields is Text this should work 

Location__r.City__c + ", " + Location__r.State_Province__c + " - " + Location__r.Country__c

 

All Answers

Steve :-/Steve :-/

What exatcly are you trying to do with that code?  wirite a Formula field or a Validation Rule, or something else?

BerettaJonBerettaJon

I believe all I am trying to do is create a formula field.

 

Basicly it is concatinating and formating city state and country into one variable(or formula)

 

Steve :-/Steve :-/

If the datatype for those fields is Text this should work 

Location__r.City__c + ", " + Location__r.State_Province__c + " - " + Location__r.Country__c

 

This was selected as the best answer
BerettaJonBerettaJon

That did the trick.  The book I am using says to use & and ' single quotes but your way works.

 

Thanks