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
SergiSergi 

Code reutilization

Hi,

I just made a VF page related to Accounts that searches state and city based on the postal code.

Thats 2 VF pages and an apex class.

 

Now I have to do the same with Leads, the code will be the same, only changing the standard controller and a couple of object calls. But the structure of the pages will be the same.

 

There's any way I can keep only one VF page, switching the standard controller or something like that?

cwall_sfdccwall_sfdc
Try breaking your page into components and passing the controller results to the component via attributes.