-
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, 2 months ago by Saravjeet Singh.
- This discussion was modified 4 years, 11 months ago by Forcetalks.
- This discussion was modified 4 years, 11 months ago by Forcetalks.
Log In to reply.
Popular Salesforce Blogs
Salesforce Lightning Experience Performance Optimization
Since being delivered, the Salesforce Lightning Experience has substantiated itself as a commendable contender to the Classic form of Salesforce. In any case, as a…
Unpacking Salesforce Experience Cloud: A Comprehensive Analysis
Introduction to Salesforce Experience Cloud Salesforce Experience Cloud, formerly branded as Salesforce Community Cloud, is a powerful tool created by Salesforce that provides businesses the…
Salesforce Einstein Chatbots – (Almost) Everything You Need to Know!
Salesforce Einstein Chatbots – With the rise of the internet and online chat, the way people prefer to communicate with businesses has changed. The new consumer…
Popular Salesforce Videos
Marketing Cloud To Become Customer Company
Leverage Marketing Cloud's ability to engage customers by delivering premium personalized experiences and building meaningful relationships with them. Contact Cyntexa to boost your business with…
How Salesforce Industries can Help Organizations to Save Millions?
Salesforce Industries i.e Vlocity empowers businesses with powerful platforms to boost collaboration and makes it easy to deliver great customer experiences. It provides tailored solutions…
Introduction to Salesforce Orchestrator
Flow Orchestrator was created so admins like you can quickly create sophisticated multi-user, multi-step automated business processes with clicks, not code. Experienced Salesforce Admins will…
Popular Salesforce Infographics
The Ultimate Dreamforce Parties 2019
Salesforce Dreamforce has it all. 2700+ sessions, workshops, hands-on demos, product launches, and whatnot. But everyone deserves breaks in between these gripping sessions, right? Dreamforce parties are a…
Top 10 Salesforce Consulting Companies in India
Salesforce is the leading cloud-based Customer Relationship Management (CRM) platform. It facilitates improving customer relationships by streamlining sales, marketing, and support processes for your business.…
Salesforce - Key For Your Industry Solutions
Salesforce endlessly improves the productivity and performance of the company. To enhance the customer experience and generate more revenue many industries will be opting for…