+ 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) 
SteveMo__cSteveMo__c

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

SteveMo__cSteveMo__c

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)

 

SteveMo__cSteveMo__c

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