-
How to Pass the value of Apex:inputField to the extension controller of contact in Salesforce?
Ho to Pass the value of Apex:inputField to the extension controller of contact.
VF Page Code:
<apex:page standardController="Contact" extensions="ReplacementContactController">
<apex:form>
<apex:pageBlock title="Contacts List" id="contacts_list">
<apex:pageBlockSection>
<apex:inputField value="{!Contact.Reason_Inactive__c}" />
<apex:inputField value="{!Contact.Replacement_Contact__c}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons>
<apex:commandButton value="Save" action="{!SaveAction}"/>
<apex:commandButton value="Cancel" action="{!Cancel}"/></apex:pageBlockButtons>
</apex:pageBlock>
</apex:form></apex:page>Controller code:
public class ReplacementContactController {
public Id cntId;
public String reasonInactive{get;set;}
public Contact contact{get;set;}public ReplacementContactController(ApexPages.StandardController controller) {
cntId = controller.getId();
}public void SaveAction() {
Contact cnt = [SELECT FirstName, LastName, Title, Inactive__c,Reason_Inactive__c FROM Contact where Id =:cntId];
cnt.Inactive__c = True;
update cnt;
}}
***************************************************************
Problem is, I am not bale to pass the selected value for the 2 input fields to the controller
-
This discussion was modified 5 years, 5 months ago by
Saravjeet Singh.
-
This discussion was modified 5 years, 2 months ago by
Forcetalks.
-
This discussion was modified 5 years, 2 months ago by
Forcetalks.
-
This discussion was modified 5 years, 5 months ago by
Log In to reply.
Popular Salesforce Blogs

Make your Salesforce life easy with Salesforce advanced code searcher and ORGanizer for Salesforce
Salesforce advanced code searcher and ORGanizer for Salesforce, both are google chrome's extensions which adds an extra features to your salesforce org. Salesforce advanced code…

What Does a Salesforce Admin Do and Why Do You Need One?
Salesforce is the world’s number one customer relationship management (CRM) platform. Nowadays, more than 150,000 companies use Salesforce to grow their businesses, which has made…

Discover the Five Ways that Salesforce Creates Best Value CRM Year after Year
The Salesforce CRM and Sales integration architecture provide better deals following and continuous permeability, more fast-witted business choices as well as successful offering for an…
Popular Salesforce Videos
Salesforce Health Cloud – Creating Patient Relationships Not Records
Unfortunately, the gruesome truth facing the world today is the ever increasing pressure of diseases due to chronic disorders, pollution, growing age, and definitely increasing…
Accelerate Revenue by Simplifying Partner Data Exchange
Adeptia Webinar :: Self-service approach to set up secured B2B data exchanges. Allowing IT to focus on governance for ensuring compliance, security, and control.Reducing IT…
Schedule Apex Jobs with Lighting Web Components | Developer Quick Takes
Lightning Web Components gives you the ability to give your users a great user experience when interacting with Salesforce. In this example, we will take…
Popular Salesforce Infographics

Salesforce vs. HubSpot: Which CRM is Best For Your Business?
Salesforce has highly customizable lead management and scoring, while HubSpot can get small businesses up and running quickly with lead generation via content marketing. HubSpot…

Growth of Salesforce (Data and figures)
Salesforce.com is the #1 Customer Relationship Management (CRM) company in the world with regard to the market share. It provides numerous CRM software that helps…

The Working Of Salesforce CRM
Salesforce CRM is considered as the #1 CRM in the market. It has the ability to manage customer interactions of an organization through several methods.…