Visualforce page that shows Contact details using an Extension controller

Create a Visualforce page that shows Contact details using an Extension controller



Extension Controller: use to build custom functionalities that are not available at Standard controller. We can create more than one extension controller at a visualforce page.



Visualforce Page:



<apex:page standardController="Contact" extensions="contactExtension">

   

<apex:form>
<apex:inputField value="{!contact.FirstName}"/> <p/>
<apex:inputField value="{!contact.LastName}"/> <p/>
<apex:commandButton value="Save" action="{!save}"/>
    </apex:form>

</apex:page>



Extension Controller:



public class contactExtension {

private final Contact cons;
// The extension constructor initializes the private member


public contactExtension (ApexPages.StandardController stdController) {
this.cons = (Contact)stdController.getRecord();
}
return 'Hello Mr./Ms. ' + cons.LastName + ' (' + cons.id + ')';
}
If you have any confusion regarding this Blog, feel free to comment, I will
definitely resolve your issue. 😃
Also! Please comment if you want me to post any new tutorials
that you like to learn 😄😄

Trigger Most Common Interview Questions and Answers for MNCs and

Small-Mid Companies

 ⇒ https://sujay-salesforce.blogspot.com/2019/08/trigger-most-common-

interview-questions.html

Visualforce Most Common Interview Questions and Answers for MNCs and

Small-Mid Companies ⇒ *** Comming Soon ***

Apex Most Common Interview Questions and Answers for MNCs and

Small-Mid Companies ⇒ *** Comming Soon ***

Lightning Component Most Common Interview Questions

and Answers for MNCs and Small-Mid Companies ⇒ *** Comming Soon ***


Lightning Design System Most Common Interview Questions and

Answers for MNCs and Small-Mid Companies ⇒ *** Comming Soon ***

Freelancing Services At Salesforce: 

Freelancing Services

For Job Support click this URL: Job Support

Comments

Popular posts from this blog

Context variables in triggers

If you looking for Salesforce Certified Freelancer for you Salesforce org works feel free to contact us, details are in below:

Field Update Using Workflow Rules At Salesforce