-
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 6 years, 10 months ago by
Saravjeet Singh.
-
This discussion was modified 6 years, 7 months ago by
Forcetalks.
-
This discussion was modified 6 years, 7 months ago by
Forcetalks.
-
This discussion was modified 6 years, 10 months ago by
Log In to reply.
Popular Salesforce Blogs
OpenTable Enhances Global Customer Service with Agentforce
OpenTable is leveraging Agentforce to deliver faster, more personalized customer care using autonomous AI agents. This shift allows their human team to concentrate on complex…
Salesforce Year 2021 Highlights
As we come to a year-end, we cannot wrap up the year without acknowledging all the significant and game-changing work Salesforce has done in the…
Why Should You Consider Migrating To Salesforce Lightning In 2022?
Salesforce has been in the industry for over two decades and has already carved its niche in the market. The CRM platform has been consistent…
Popular Salesforce Videos
How To Start A Career In Salesforce? | Video Tutorial
Planning to start a career in Salesforce? Wondering where to head and learn. Watch this video and join this useful group for Salesforce job &…
How to Set Up Web Chat in Salesforce Service Cloud SFDC - Learn Salesforce Series with Algoworks
In this video, you will get to know what the webchat feature in Salesforce Service Cloud is all about. Learn how to - 1. Introduction…
Salesforce Interview | Marketing Cloud Success
What's it like to learn Marketing Cloud from scratch? Akasia Perran has the answers and in this video, I ask her about her experience starting…
Popular Salesforce Infographics
The 10.5 Commandments of Salesforce Users
This great piece of visual goodness presents the 10 commandments every Salesforce user needs to follow. Make sure every single one of these practices is…
AI and Salesforce Einstein Giving Customer Experience A New Direction
This Salesforce infographic will guide you with CEPTES leveraging the power of AI with new strategies and value chains.
How to Build Leads with Salesforce
Salesforce is a force to reckon with when it comes to inbound lead management. However, for certain businesses, especially smaller ones, the various add-ons and…