How do I pass a lead email address to an IFRAME? I did the following steps:
Created a new test lead.
Went into gear icon > Setup > Custom Code > VisualForce Pages, and created a new VisualForce Page like so:
<apex:page>
<apex:iframe src="https://example.com/salesforce/test.php?id={!$CurrentPage.parameters.id}" scrolling="true" id="iframe-test"/>
</apex:page>
In my test.php page on my web server, I added this:
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
header('Content-Type: text/plain');
print_r($_GET);
echo "\n\nDONE";
Exited setup.
Clicked on my lead (to show a single lead) and chose gear icon > Edit Page.
Added a new tab beside News called CUSTOM.
Clicked that tab in the page editor and dragged a VisualForce (page object) to that tab and set it to my new custom VisualForce page that I created.
Saved and Activated this change for the Org.
Exited the page editor to return to the single Lead view.
Clicked the CUSTOM tab.
Okay, so I can see an ID is passed to me of the calling page. However, is there an easy way to pass URL parameters to my IFRAME such as:
Lead.Email
Lead.MobilePhone
Lead.Phone
Lead.Name
Lead.FirstName
Lead.LastName
And, moreover, can these be URL-encoded so that they pass properly to my IFRAME?
Note I was able to get something like {!$ObjectType.Lead.Fields.Email}
to give me an email, but it appeared in an unusuable format like the following when I viewed it in my IFRAME:
common.api.soap.wsdl.Field@26ca801c