-
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, 5 months ago by
Saravjeet Singh.
-
This discussion was modified 6 years, 2 months ago by
Forcetalks.
-
This discussion was modified 6 years, 2 months ago by
Forcetalks.
-
This discussion was modified 6 years, 5 months ago by
Log In to reply.
Popular Salesforce Blogs
The Significance of Salesforce Nonprofit Cloud for Program Management
Every Nonprofit organization needs program management while planning, evaluating, and implementing an initiative for a cause. In this blog, we will go through the importance…
A Guide to Utilizing the Salesforce Customer Portal in Academia
Educational institutions have undergone significant changes over the years. Entering the early 2000s, these institutions gradually embraced technology by introducing advanced computer labs that allowed…
Types of Data Extensions in Salesforce Marketing Cloud
In Salesforce Marketing Cloud, data extensions are the tables that store our data. It can be from within Marketing Cloud, Sales Cloud, manually added/imported, or…
Popular Salesforce Videos
How To Land A Salesforce Job In India
This video explained about to land a Salesforce job in India. This is a great opportunity to enter the Salesforce echo systems for non-Salesforce professionals…
DreamTX Welcome Day 2 | Dreamforce 2020 | Salesforce
If you missed DreamTX DAY 2, then live this amazing experience here, we have covered it all for you. See the power of Customer 360,…
Kanban View and Personalisation | Salesforce Training
In this short video, we will show you the Kanban view in Salesforce Lightning and how it can be personalized. Check out this amazing and…
Popular Salesforce Infographics
State of Appexchange Salesforce Apps Market 2025
The Salesforce AppExchange continues to expand, providing businesses with innovative tools to enhance their Salesforce experience. With thousands of solutions available, the marketplace has become…
Enhance Customer Experience With Salesforce
Salesforce Makes Personalized, Consistent Digital Customer Experience a Reality. Salesforce, widely recognized as the leader in business CRM, gives organizations the tools they need to…
Salesforce Einstein Features Across The Clouds
The infographic shows how Salesforce Einstein will be affecting each individual cloud.