+ Start a Discussion
Donny.ax1663Donny.ax1663 

Shopping Cart Items

Hello,

 

I find myself stumped here, I am hoping you can help again.  I am trying to combine two shopping cart fields in a new custom formula field.

 

The first field is "pymt__Quantity__c" which is a number, the second is "pymt__Product_Code__c" which is text.  What I need to happen is this, if a customer ordered 2 GREENC (2 being the payment quantity and GREENC being the Product Code) it would populate the new field as 2:GREENC.  This is what I have tried but I get an error.  

 

pymt__Quantity__c & ":" & TEXT(pymt__Product_Code__c)

 

When creating the new field as an object in payment I get error: "Field pymt__Quantity__c does not exist. Check spelling.

 

When creating the new field as an object in shopping cart item I get error: "Incorrect parameter type for operator '&'. Expected Text, received a number.

 

Any help would be very appreciated.

 

I'm a newbie!  

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Prafull G.Prafull G.
As JeffM mentioned, use TEXT() function to change Number to text.

TEXT(pymt__Quantity__c) & ":" & pymt__Product_Code__c

All Answers

Jeff MayJeff May

Since your formula field is a text field, you need to use the TEXT() function around your number fields to turn them into text.

Prafull G.Prafull G.
As JeffM mentioned, use TEXT() function to change Number to text.

TEXT(pymt__Quantity__c) & ":" & pymt__Product_Code__c
This was selected as the best answer
Donny.ax1663Donny.ax1663

Thank you sir.  That is exactly what I was doing wrong.