Use Case :- Let's say we need to show different visualforce pages as iframes based on the URL. For example on sidebar, it shows account specific details on account page layout, for opportunity, it shows opportunity details
Steps to accomplish this :-
1. Create a html area type component on home page. Name it like welcome page.
2. Keep the component position as Narrow Left column and in the body click on show html.
3. Put the below content in the body and save the component.
<iframe id="pwelcomesidebar"></iframe>
<script type="text/javascript">
if (document.getElementById) {
var URL = window.location.href;
if (URL.indexOf('/001')>=0) {
document.getElementById('pwelcomesidebar').src = '/apex/welcomepage_account?core.apexpages.devmode.url=1';
} else {
document.getElementById('pwelcomesidebar').src = '/apex/welcomepage_opportunity?core.apexpages.devmode.url=1';
}
}
</script>
4. Now add this component to home page layouts.
No comments:
Post a Comment