You need to sign in to do that
Don't have an account?
ravindra reddy
i got the error like System.NullPointerException: Attempt to de-reference a null object Class.myControllerExtension.getGreeting: line 12, column 1
Hi ,
i am writing extension class for account and when i am running the code i getting above error , here i am posting code also
public class myControllerExtension {
private final Account acct;
public myControllerExtension(ApexPages.StandardSetController stdController){
this.acct=(Account)stdController.getRecord();
}
public String getGreeting(){
return 'hello'+acct.name+'('+acct.id+')';
}
}
vf page
apex:page standardController="Account" extensions="myControllerExtension" >
{!greeting}
<apex:form>
<apex:inputField value="{!account.name}"/>
<apex:commandButton value="save" action="{!save}"/>
</apex:form>
</apex:page>
please help me to slove the issue
i am writing extension class for account and when i am running the code i getting above error , here i am posting code also
public class myControllerExtension {
private final Account acct;
public myControllerExtension(ApexPages.StandardSetController stdController){
this.acct=(Account)stdController.getRecord();
}
public String getGreeting(){
return 'hello'+acct.name+'('+acct.id+')';
}
}
vf page
apex:page standardController="Account" extensions="myControllerExtension" >
{!greeting}
<apex:form>
<apex:inputField value="{!account.name}"/>
<apex:commandButton value="save" action="{!save}"/>
</apex:form>
</apex:page>
please help me to slove the issue
All Answers
Page like below
Let us know if this will help you
instead of
use
Best Regards,
Amit Ghadage.
i am getting same error, even I am update your code .
Thanks & Regards
Ravindra
now its woking