+ Start a Discussion
Kathryn Lee 10Kathryn Lee 10 

Trailhead: Creating Wizards with Visualforce Flows error

I'm working on the Creating Wizards with Visualforce Flows challenge and I am getting an error on the Opportunity Name formula that I created. 

The error is: OpportunityName (Formula): The formula expression is invalid: Syntax error. Found 'Company_Name'

Here is my formula (I have it set to Text): ​{!Company_Name} "-" {!Last_Name}
Best Answer chosen by Kathryn Lee 10
Shyama B SShyama B S
Hi Kathryn,
Please try this and let me know:
{!Company_Name}+'-'+{!Last_name}

Thanks,
Shyama

All Answers

Shyama B SShyama B S
Hi Kathryn,
Please try this and let me know:
{!Company_Name}+'-'+{!Last_name}

Thanks,
Shyama
This was selected as the best answer
Kathryn Lee 10Kathryn Lee 10
That worked. I knew it was going to be something simple like that. Although, can you tell me how I was supposed to know to use the (+)? Is that part of common coding language that I don't know as a button-click admin?  I tried using && like I do to concatenate in formulas, but that didn't work either. 
Shyama B SShyama B S
&& is AND operator and & is the concatenate operator. In salesforce formula, you can use + also which concatenates strings.
Kathryn Lee 10Kathryn Lee 10
Ah, yes. It works with the & as well. I evidently really rely on those extra helps built into the formula builder on other objects. 
Shyama B SShyama B S
Please mark the answer and close the question. Have a great day! 
Thanks