You need to sign in to do that
Don't have an account?
ElcalvoMike
Controller problems for APEX class
I cannot figure out how to reference variables from the controller initiated in the constructor.
I get Variable does not exist: opp.fname__c. However this is the name of this custom field.
Am i not calling this correctly?
public class MailClass { private final Opportunity opp; public mailClass(ApexPages.StandardController controller) { this.opp=(Opportunity)controller.getRecord(); } static final string Subject='Hi ' + opp.fname__c;
With
you're intializing a static variable by trying to reference an instance field. You can't do this. Are you sure you want Subject to be static?
All Answers
With
you're intializing a static variable by trying to reference an instance field. You can't do this. Are you sure you want Subject to be static?
This string will be used in a later function in this class that creates a dynamic HTML email.
I tried changing the delaration to private/public and just string. No luck...what do I set it to?
Oh I got it. Set to just string and it did the trick! Thanks for the direction.