You need to sign in to do that
Don't have an account?
Ankit Chauhan 10
How can I use only one extension controller for Standard Salesforce object like Leads, Account, Contacts.
Hi All,
I'm trying to write a common controller extension for standard salesforce object like lead, account and contact. Since the extension controller constructor is generic I'm planning to use the same extension class (Controller class- APEX). Is there any cons to this approach. I'm basically collecting the email and phone from these standard object and perform some operation in real-time.
My approach in short:
1. I will give a custom button on the Salesforce standard object like Lead, Account and contact Visualforce Page. (non-override approach)
2. Please note that this approach is only for interactive use case which means while creating or editing a record (Lead, Account and Contact) in Salesforce.
3. I'm planning to handle this custom button logic in Extension controller class (say CommonControllerExtension).
4. I will perform my logic on SO email and phone.
For example:
public CommonControllerExtension(ApexPages.StandardController sController)
{
this.sController = sController;
}
Any help please.
I'm trying to write a common controller extension for standard salesforce object like lead, account and contact. Since the extension controller constructor is generic I'm planning to use the same extension class (Controller class- APEX). Is there any cons to this approach. I'm basically collecting the email and phone from these standard object and perform some operation in real-time.
My approach in short:
1. I will give a custom button on the Salesforce standard object like Lead, Account and contact Visualforce Page. (non-override approach)
2. Please note that this approach is only for interactive use case which means while creating or editing a record (Lead, Account and Contact) in Salesforce.
3. I'm planning to handle this custom button logic in Extension controller class (say CommonControllerExtension).
4. I will perform my logic on SO email and phone.
For example:
public CommonControllerExtension(ApexPages.StandardController sController)
{
this.sController = sController;
}
Any help please.
Yes, Possible please check the above code.
Thanks
Aniket
If you find the solution as Answer , please mark.
Is there any cons to this approach?
Thanks in advance.
This is a approach, Best practice. More like Factory design Pattern.
Mark the replt ANSWER, if it has solved your purpose.
Thanks
Aniket