You need to sign in to do that
Don't have an account?
Karleen Mendoza
Iframe link not displaying in visualforce page?
I am trying to display a record detail page in a visualforce page so it can show in a homepage component. I used the following code:
The page doesn't render... I understand that this could be done via using <apex:detail> but I have no idea where to begin with that. I'm not too familiar yet with Apex.
My goal here is to view the specific record details of one record on a home page component
<apex:page > <apex:iframe src="https://cs91.salesforce.com/a382F0000001HRW" scrolling="true" id="theIframe"/> </apex:page>
The page doesn't render... I understand that this could be done via using <apex:detail> but I have no idea where to begin with that. I'm not too familiar yet with Apex.
My goal here is to view the specific record details of one record on a home page component
The following Visualforce page works on the Home Page but as you mentioned you need to disable the Clickjack security because it is the complete detail page without the related lists.
Disable Clickjack Protection
https://help.salesforce.com/articleView?id=000240096&type=1
The following code works as a Visualforce page used on the Home Page (tested) and it is the shortes but the Clickjack security has been disabled.
The jQuery short code removes the buttons "Clone" "Edit" and "Delete" and disable all the links ('a') existing on the page so the detail page is "almost" perfectly read only.
Tell me if that doesn't work.
Alain
All Answers
Below is the snippet, how you can make use of apex:detail in your scenerio. Suppose your object API name is 'MyObject__c', Your page code would look like below:
Then click the preview button to preview your page and pass record id in page URL.
For example, if 001D000000IRt53 is your record id, the resulting URL should be:
https://Salesforce_instance/apex/myPage?id=001D000000IRt53
Hope this will help. Kindly let me know in case any query.
Please like the answer and mark it as best if this helps.
Thanks,
Aman
Hi Aman,
Thanks for the tip. I'd like to have this record detail viewable on the Home Page so when my users open SFDC, they see the record right away without having to click a button. But I have no idea how to pass the record ID so it can be viewable on the home page. Is it possible to to do this without creating a link?
Setup --> Customize --> Home --> Home Page Component -- > click new under Custom Components --> Select HTML area --> paste your code line .
for an example, line code should be Hope this helps,
Thanks,
Aman
Aman
The following Visualforce page works on the Home Page but as you mentioned you need to disable the Clickjack security because it is the complete detail page without the related lists.
Disable Clickjack Protection
https://help.salesforce.com/articleView?id=000240096&type=1
The following code works as a Visualforce page used on the Home Page (tested) and it is the shortes but the Clickjack security has been disabled.
The jQuery short code removes the buttons "Clone" "Edit" and "Delete" and disable all the links ('a') existing on the page so the detail page is "almost" perfectly read only.
Tell me if that doesn't work.
Alain