-
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, 11 months ago by
Saravjeet Singh.
-
This discussion was modified 6 years, 8 months ago by
Forcetalks.
-
This discussion was modified 6 years, 8 months ago by
Forcetalks.
-
This discussion was modified 6 years, 11 months ago by
Log In to reply.
Popular Salesforce Blogs
Salesforce - Leading Player in the Game of Healthcare Management
In the rapidly evolving healthcare sector, technology is transforming patient care and operational efficiency. Innovations like Artificial Intelligence (AI), Virtual Reality (VR), the Internet of…
Quickbooks and Salesforce Integration: Rest API
In today’s business landscape, seamless integration between different software systems is essential for maximizing productivity and efficiency. When it comes to managing financial data and…
How to create custom Lookup in Lightning Component
Hi guys, Its time to use Lightning Component Framework. This framework is used to build a SPA. SPA is not a massage therapy as you…
Popular Salesforce Videos
Salesforce Rest API | Http Methods | Salesforce Integration
This video we will discuss - What is API Different API In Salesforce Rest API in Salesforce HTTP Request HTTP methods Workbench to make HTTP…
Salesforce To RDS Integration Through Dell Boomi | Salesforce Tutorial
Salesforce to RDS integration through Dell Boomi. This tutorial will cover the following points - 1. Introduction Take a quick glimpse at integrating accounts from…
See what amazing things Cauzali can add to your Salesforce solution - without code
Use Cauzali to add functionality to your Salesforce community solution. In this video, we have a focus on Salesforce Financial Service Cloud, but Cauzali works…
Popular Salesforce Infographics
How Customer Experience Is Rewriting the Rules of Business Success
Your guide to customer experience - Customers expectations are changing. And as they change, businesses face sky high standards for delivering customer experience that's a…
Salesforce CPQ Services & Processes: InfoDrive Solutions
Simplify your CPQ processes with InfoDrive Solutions Salesforce CPQ services. Work flexibly from any location, on any device, enhancing productivity and increasing deal-closure chances for…
Streamlining the Sales Process with Salesforce CPQ
Implementing Salesforce CPQ offers numerous business advantages, such as automating tasks, including sales quotations and price determination. Businesses that use Salesforce CPQ can expect increased…