New answers tagged

1

An extension controller must have a constructor that receives an ApexPages.StandardController object (as it's bound to an object standard controller). In your case: public ShowErroronVFPage(ApexPages.StandardController controller){ this.acc = (Account)controller.getRecord(); } Said that: I recommend having a more meaningful name for your standard ...


1

You don't need to query the records, just bind directly to the record in the controller: <apex:page standardController="Opportunity" extensions="Opportunity_UpdExt" docType="html-5.0" sidebar="true" lightningstylesheets="true"> <apex:form> <apex:pageBlock> <apex:...


1

public PageReference save() { this.ctrl.save(); return Page.Congratulations; } You're not checking to see if the record actually saved. Try: public PageReference save() { // Returns PageReference only on success if(this.ctrl.save() != null) { return Page.Congratulations; } // There was an error. return null; } As far as ...


2

The problem lies in your controller public ApexPages.StandardController Opportunity {get; set;} public IntakeExtension(ApexPages.StandardController controller) { Opportunity = controller; } The variable Opportunity is bound to the type ApexPages.StandardController. This then confuses the VF compiler when it is resolving {!Opportunity....


0

The issue is that Customer_Name__c was not created in the sandbox you're encountering this error in, but rather deployed to it. When fields are deployed the permissions/FLS do not come along with it, and need to be set. Not even system administrators can read/query the field without doing this (which is the issue you're running into). Salesforce doesn't ...


Top 50 recent answers are included