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
NickNick 

Trouble using Merge Field with a Function

{!SUBSTITUTE("This is a test","a","/") }
evaluates to "This is / test", as expected.
 
But {!SUBSTITUTE("{!Opportunity.Name}","a","/") }
evaluates *literally* to "{!Opportunity.N/me}", instead of embedding slashes in the actual Opportunity Name.
 
Am I doing something wrong or is this broken. I can't find any documentation that addresses this.
 
Nick
 
cheenathcheenath
I guess you could try:

{!SUBSTITUTE({!Opportunity.Name},"a","/") }

or this:

{!SUBSTITUTE(Opportunity.Name,"a","/") }

Just a guess.


Doug ChasmanDoug Chasman
{!SUBSTITUTE(Opportunity.Name,"a","/") } is what you want - no guessing about it.

The {! } delimiters are just like <%= %> in other templating technologies like JSP and ASP.NET and demark the start and end of formula expressions (one of the simplest being just a field reference - the only thing available prior to Winter '07). Once inside {! } you no longer need or want additional {! }'s.
NickNick

Thanks guys--that was perfect! Don't use JSP or ASP.NET, so had no clue. I guess you just have to know. Now I do.

Nick