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
Tobias HaggeTobias Hagge 

Account object Vf Clone

Is it possible to build a perfect clone of the Account Page Layout, since the referenced link is only salesforce.com/AccountID?

Bear with me, since this is my first experience relating using code. 
Best Answer chosen by Tobias Hagge
Tobias HaggeTobias Hagge
I think I almost figured it out.
<apex:page StandardController="Opportunity">   

    <script type="text/javascript">

       window.location = '/{!Opportunity.AccountID}/m?isdtp=vw';

    </script>

</apex:page>
Works brilliant for the Mini Page Layout. However

<apex:page StandardController="Opportunity">   

    <script type="text/javascript">

       window.location = '/{!Opportunity.AccountID}?isdtp=vw';

    </script>

</apex:page>
Should give out the normal full page layout, but doesn't. Has it anything to do with this page not running on javascript?



All Answers

Vidhyasagaran MuralidharanVidhyasagaran Muralidharan
<apex:page tabstyle="account">
in the VF page.
Ramu_SFDCRamu_SFDC
see if the examples provided in the below article helps

http://writeforce.blogspot.in/2013/01/building-visualforce-pages-for-standard_23.html
Tom Maple2Tom Maple2
It depends if you want to implement another Page Layout (easy) or a create Visualforce page (harder). If you want to use a page layout, go to Setup->Customize->Accounts->Page Layouts, click the New button. On the next page, select the existing Account layout to clone from, give your new layout a name, and click Save.  From there you will be taken to the Page Layout editor to make changes if you want.

After you save your new layout, then you need to assign them to a user profile to have it show up for a user. From the list of page layouts, click the Page Layout Assignment button. You will get a list of all your Profiles with their assigned layout. Click the Edit Assignment button to change the appropriate profiles to your new layout.

If instead you want to use a Visualforce page, you first have to create the Visualforce page which uses the Account standard controller. I will not go into that process here, you can read the documentation.  Then you need to replace Salesforce use of layouts to use your new VF page.  Go to Setup->Customize->Accounts->Buttons, Links, Actions.  On the line for New, click the Edit hyperlink. On the next page, switch the Override With option to Visualforce Page and select your VF page from the pick list.   If your page doesn't show up under the pick list, you didn't use the Account standard controller for your VF page.
Tobias HaggeTobias Hagge
The second option, creating a VF page. However I don't want to replace the use of original page layout for Account with the VF page. I want to use the VF page to be a custom consule component of Opportunities. (Mini Page Layout is unsufficient, because of limitations, f.e. it only uses one column, etc.)

I did create a VF page with the Account as controller, but now is the question if I would have to rebuild the whole Account Page Layout in Apex, or just get it to load the normal Account Page.

Thanks for the help so far.
Tobias HaggeTobias Hagge
I think I almost figured it out.
<apex:page StandardController="Opportunity">   

    <script type="text/javascript">

       window.location = '/{!Opportunity.AccountID}/m?isdtp=vw';

    </script>

</apex:page>
Works brilliant for the Mini Page Layout. However

<apex:page StandardController="Opportunity">   

    <script type="text/javascript">

       window.location = '/{!Opportunity.AccountID}?isdtp=vw';

    </script>

</apex:page>
Should give out the normal full page layout, but doesn't. Has it anything to do with this page not running on javascript?



This was selected as the best answer
Tobias HaggeTobias Hagge
I think I figured the problem out: http://docs.releasenotes.salesforce.com/en-gb/winter14/release-notes/rn_186_forcecom_cruc_setup_pages.htm
The workaround is, that it actually works in the Opportunity console, because it then refers to the same URL.