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
Suresh RaghuramSuresh Raghuram 

URLFOR(url and parameters)

Hi Community,

 

I have custom button on std Obj detail page when i click it the script behind the sceens will run and popup a modal dialog .

 

in the modal dialog i am displaying a vf page. The values in the vf Page will display based on the 3 parameters in the url.

 

So i want the syntax for the the following line.

 

var iframe_url='{URLFOR("/apex/VFpagename?scontrolcatching=1&id='{sObj.Id}&Name='{!sObj.Name}'")}

 

I tried different other ways but i did not get through. Any help or suggestions appriciated.

 

Thanks,

 

Best Answer chosen by Admin (Salesforce Developers) 
Suresh RaghuramSuresh Raghuram

I made it like this

 

var iframe_url ="/apex/vfpageName?scontrlcatcing=1&id="+'{sobj.id}'+"&Name="+'{!sobj.Name}';

 

passes the iframe_url to the html as a parameter.

 

That worked.

 

Thanks for the reply.

 

I tried as you said and finally i recognised the URLFOR is not best fir for passing  dynamic URL .

All Answers

MoUsmanMoUsman
HI suree,

Please try this
var iframe_url='{!URLFOR("/apex/VFpagename?scontrolcatching=1&id=sObj.Id&Name=sObj.Name")}'

If you are still facing issue please let me know.
--
Thanks
Usman
Suresh RaghuramSuresh Raghuram

I made it like this

 

var iframe_url ="/apex/vfpageName?scontrlcatcing=1&id="+'{sobj.id}'+"&Name="+'{!sobj.Name}';

 

passes the iframe_url to the html as a parameter.

 

That worked.

 

Thanks for the reply.

 

I tried as you said and finally i recognised the URLFOR is not best fir for passing  dynamic URL .

This was selected as the best answer