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
The_A-RodThe_A-Rod 

iframe newbie

I would like to display an iFrame on a custom object record page and pass a value from one of the fields to the URL.

For example I have the value abcdefg on my record, so i need to pass that to the URL

So let say the full URL should be:
http://xyz/User/User?&d_user_name=abcdefg&source=1


I've looked at this page but it doesn't help me that much as I am an Apex and VF newbie.
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_iframe.htm

How would I do this?!
Ashish DevAshish Dev
For iFrame you need to construct the "src" url in javascript and set it from javascript itself like shown below.

function setSrcIFrame() { 
   document.getElementById('myIframe').src = "http://exampleexample.com"; 
}

<iframe id="myIframe" src="http://example.com/" "></iframe>
apex:iframe can be used as well.
You might also need to hide iframe until you do not change URL.
Call "setSrcIFrame" from button click after which iframe is loaded or on pageload.
 
The_A-RodThe_A-Rod
I'm afriad that doesn't mean much to me. I'm a beginner unfortunately.

Is there a tutorial online somewhere maybe? I did some googling but couldn't find anything helpful