UPDATE 12/29/2020:
For clarity, and as I accepted an answer here, I am posting a new question for additional help with new issues. The new question can be reviewed here.
UPDATE:
I am trying to switch everything from a custom object to SF's object, Opportunity. When everything was linked to the custom object, the code worked perfectly. Why would it be throwing errors on Opportunity object?
- I only get the Error: Unknown property 'ApexPages.StandardController.Customer_Name__c'
when my extensions are part of the VF page.
My Extentions are:
public with sharing class IntakeExtension {
public ApexPages.StandardController Opportunity {get; set;}
public IntakeExtension(ApexPages.StandardController controller) {
Opportunity = controller;
}
public PageReference save() {
Opportunity.save();
return Page.Congratulations;
}
}
public with sharing class ShouldShowMedSection{
public ShouldShowMedSection(ApexPages.StandardController paramController) {
Opportunity = paramController;}
public ApexPages.StandardController Opportunity {get; set;}
public Boolean getShouldShowMedSection() {
Opportunity record = (Opportunity)Opportunity.getRecord();
if(
record.Personal_Care_Concerns__c != null && record.Personal_Care_Concerns__c.contains('Medication')
)
{
return true;
}
return false;
}
}
I've updated 'InputField' to InputText and now get this error Error: Unknown property 'ApexPages.StandardController.Customer_Name__c'
Receiving this error:
Error: Could not resolve the entity from apex:inputField value binding '{!Opportunity.Customer_Name__c}'. apex:inputField can only be used with SObjects, or objects that are Visualforce field component resolvable.
- I'm in a sandbox and my Opportunity object has a Customer_Name__c field on it. Not sure why I'm getting the error or how to resolve?
Code here:
<apex:page standardController="Opportunity" extensions="IntakeExtension,ShouldShowSHSection,ShouldShowSHwECSection,ShouldShowPERSSection,ShouldShowMedSection,ShouldShowRingSection" standardStyleSheets="false" showHeader="false" sidebar="false">
<apex:stylesheet value="{!$Resource.styleForIntake}"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<body>
<!-- multistep form -->
<apex:form Id="msform" styleClass="form">
<!-- progressbar -->
<br></br><br></br>
<ul id="progressbar">
<li class="active">Client Info</li>
<li>Residence </li>
<li>Concerns </li>
<li>Tech Comfort</li>
<li>Recommendation</li>
</ul>
<!-- fieldsets -->
<br></br><br></br>
<fieldset>
<br></br><br></br>
<h2 class="fs-title">Client Information</h2>
<h3 class="fs-subtitle">Here, we will gather information specific to the client.</h3> <br></br>
<p>
Client Name (First and Last Initial): <br></br>
<span class="required-text">*required</span>
<br></br>
</p>
<apex:inputField styleClass="fieldset" label="Client Name (First and Last Intial):" value="{!Opportunity.Customer_Name__c}"/>
<br></br> <br></br>
<p>
Customer_Name__c
field in this sandbox, or did you deploy it to this sandbox from another sandbox/scratch org? If you didn't create the field in the target sandbox, you need to set up FLS yourself.