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
Koen (BvD)Koen (BvD) 

How does a VF page replace an s-control that is used to custumize page layout?

I had a quick look into visual force pages to see if I would be able to get more out of it, especially now that s-controls are end of life. but there is one aspect where I don't see how it replaces s-controls. Previously you could build an s-control with an image, links and other elements on it and then drop it onto an existing page layout (for example for accounts). How would you do this with visual force pages. The only way I see is to build a new page with the components from the standard account editing page, but normally an s-control you put in a package, distribute it and then after importing you just add it to your already personalized page ...

 

Koen.

Best Answer chosen by Admin (Salesforce Developers) 
Anand@SAASAnand@SAAS

If you visual force page uses a standard controller, you can drop the visual force page into an existing page layout for hte object. For e.g., if you have a custom component that deals primarily with Account then you would define your visual force page as:

 

<apex:page standardController="Account" extensions="MyAccountController"...>

 

All custom rendering logic goes in here...

</apex:page> 

 

Once you save this page, you'll see it in the VisualForce page area of the page layour editor. 

All Answers

Anand@SAASAnand@SAAS

If you visual force page uses a standard controller, you can drop the visual force page into an existing page layout for hte object. For e.g., if you have a custom component that deals primarily with Account then you would define your visual force page as:

 

<apex:page standardController="Account" extensions="MyAccountController"...>

 

All custom rendering logic goes in here...

</apex:page> 

 

Once you save this page, you'll see it in the VisualForce page area of the page layour editor. 

This was selected as the best answer
Koen (BvD)Koen (BvD)
Thank you very much for this fast reply. That seems to do the trick, it is very helpfull, because when digging into a new technology the first hours are always a bit difficult to get the spirit. I think I'm gonna like Visual force pages
Koen (BvD)Koen (BvD)
Just want to come back on my previous statement "I think I'm gonna like Visual force" : the more I work with it the more I get frustrated, because I can't work out how it works, can't find the necessary documention, stumble on limitations ...  I''ll probably hate it more than any other IT technology I ever learned by the end of the month.
JeriMorrisJeriMorris

Once I have a VF page that uses a standard controller, how do I add it to my page layout?

 

The page layout editor has options to allow me to drag Fields, Button, Custom S-Controls, and Related Lists onto the page, but nowhere do i see an option to drag a Visualforce page into the page layout editor.

 

(I'm currently in a sandbox on cs1.)

Koen (BvD)Koen (BvD)

If your standardcontroller is for example "account" then it should atutomatically apper as an item to add on the account page layout editor. I didn't see it either the first time, but I don't remember what I did wrongl Now it works every time, use the correct standard controller and it appears immediately. In the wysywig editor a new line appears under sthe selection where you already see "s-controls".

 

Koen.