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

Embedding Standard Page Layout in VF Page

I have designed a VF page and there is a section to generate a new task.  So i wonder is there any way that i can just embed the Task Standard Paglayout in my VF Page as i dont want to hardcode the layout. Apart from that i have multiple layouts assigned to different different profile and my VF page will be accessed by all these profile .


So if there is no other way, then i have generate a section for each profile and render them accordingly. but if there is any change in the pagelayout then i have to modify my VF page also. so i dont want to use this approach.


If anybody have any solutuion then please help me.


I think you'll need to use an apex:iframe to pull in the standard new task page, as there's no standard component that allows you to get at the New page for an sobject.


Thanks for the prompt reply.

but i think that wont solve my purpose as well. As i want to grab the page block sections part only not the buttons. Also i want to controll the task creation from other sections in the VF Page.


is it possible in that way?



In that case I think you'll need to recreate the sections on your VF page.  You should be able to alleviate the worst of things by using field sets to control which fields get output.  Here's a blog post of mine on the subject:


Thats exactly what i am using rightnow but just checking if anybody know better solution than this.

As in this case also, i have to create multiple fieldsets as per record type and profile and have to render that particular fieldset  the current record type and profile.


Thanks for taking interest in my problem...


Yeah, that is a bummer.  I was hoping to be able to iterate all the field sets defined for an object and decide programmatically whether to use them, but that doesn't work either.