-
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 7 years, 1 month ago by
Saravjeet Singh.
-
This discussion was modified 6 years, 10 months ago by
Forcetalks.
-
This discussion was modified 6 years, 10 months ago by
Forcetalks.
-
This discussion was modified 7 years, 1 month ago by
Log In to reply.
Popular Salesforce Blogs
How Salesforce Health Cloud can Improve a Company’s Performance in the Healthcare Industry?
Modern healthcare systems face a range of challenges: growing patient volume, lack of resources, the need to improve the quality and timeliness of service delivery.…
Types of Salesforce Support (Customer Success) Plans You’ll See out in the Wild
Customer success is when the customers can achieve their desired business outcomes by leveraging the Salesforce platform. Providing a suitable customer success plan means providing…
Billing Automation with Salesforce Billing: A Game Changer for Your Business
It is readily apparent that businesses today face the increased pace of technological advancements, fickle and demanding customers, and aggressive competition that they faced yesterday…
Popular Salesforce Videos
Welcome to the New World of Data Collection | Salesforce | Summer Internship
Secure data collection built for your needs. With FormAssembly, your organization can streamline outdated processes and power important business initiatives. To enroll Contact us +91…
Topics to Master to Crack Your Salesforce Administrator Certification Exam
If you're preparing for your Salesforce Administrator Certification and wondering there's a lot that you need to cover from the study material provided by Salesforce.…
Generative AI: What Are Its Benefits For Businesses?
Imagine a world where computers can help businesses come up with creative ideas, solve tricky problems, and even predict what customers might want next. That's…
Popular Salesforce Infographics
Top 5 ETL Tools for Salesforce Data Migration
There are plenty of ETL tools for Salesforce in the market, with varying degrees of functionality and popularity. All tools are more or less the…
Salesforce Dreamforce: A History of Innovation
Salesforce is anything but your average technology company. From its 1-1-1 philanthropic model to the scrappy startup culture, Salesforce defies traditional logic for how a…
See How Building Apps on Salesforce Has Tremendous ROI
The pressure that businesses today are under to reduce costs, improve agility, and deliver better results is no joke. Couple that with rapidly evolving technology…