I need to add a detail button to the Lead page to provide data entry for a custom child object ( Interest_Criteria__c ).
In my controller extension I have:
public class NewCriteriaControllerExtension {
private final Lead aLead;
public NewCriteriaControllerExtension(ApexPages.StandardController stdController) {
this.aLead = (Lead)stdController.getRecord();
string LandSF='';
String LandAcres='';
}
public void CreateNewIC(){
InterestCriteria__c InterestCriteria;
InterestCriteria.Land_Acres__c=decimal.valueof(LandAcres);
InterestCriteria.Land_SF__c=decimal.valueof(LandSF);
InterestCriteria.LeadID__c=LEADIDFromLeadDetailPage;
insert InterestCriteria;
}
}
And in VF:
<apex:inputtext id="LandAcres" size="10" value="{!LandAcres}"/>
The compiler doesn't recognize standardcontroller.LandAcres so...
- What should an inputbox look like and how do I define any relevant variables?
- Because I need to access this VF page from a button on the lead detail, I assume I need to use a controller extension class, but please advise otherwise.