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
sf.ax1637sf.ax1637 

Inserting field values that contain references to other field values

We have a data object that contains a field that we want to allow the user to specify an expression that includes values from other fields.

 

For example:

 

OurObj.linkPattern=http://google.com?Q={!Account.Name}

 

We then want to render a hyperlink in a visual force page that would emit:

 

<a href="http://google.com?Q=My Account Name">Search</a>

 

 

 

 

Here's what we have tried:

 

<apex:ouputLink value="{!OurObj.linkPattern}">Search</apex:outputLink>

 

 

This resolves to:

 

<a href="http://google.com?Q={!Account.name}">Search</a>

 

 

It seems like we need to double resolve the value somehow.

 

We are hoping for some suggestions from the community!

 

Thanks,

 

- K

AmitSahuAmitSahu

IN your controller get a new variable say string x;

then:

 OurObj.linkPattern=http://google.com?Q={!Account.Name} ;
x= OurObj.linkPattern ; 

 


in VF page use:
<apex:ouputLink value="{!x}">Search</apex:outputLink>

sf.ax1637sf.ax1637

We have tried this, and it does not work.

 

The resulting html has:

 

<a href="http://google.com?Q={!Account.Name}">

 

{!Account.Name} does not resolve to the actual value.