Class.NewGroupSeasonController.execute: line 27, column 91 External entry point
You need to sign in to do that
Don't have an account?
Execbiz
Visualforce Error..Help!
Hi All,
I am new to Salesforce and I keep getting this error message and have no idea how to fix it. Any ideas?
System.NullPointerException: Attempt to de-reference a null object
please write the code too
Code Sample:
public void execute(){
//Apply the number and season of the current group to the number and season variables
this.currentGrpNumber = this.currentGrp.Group_Number__c;
this.currentGrpSeason = this.currentGrp.Season__c;
//Integer currentGrpNoInt = this.currentGrpNumber;
//Update current group so that the name is "Group _ - Season _" instead of Active, remove active checkbox
String updatedOldGrpName = 'Group ' + this.currentGrpNumber.intvalue() + ' - Season ' + this.currentGrpSeason.intvalue();
this.currentGrp.Name = updatedOldGrpName;
this.currentGrp.Active__c = False;
update this.currentGrp;
//If next season's group already exists, change name and Active checkbox
for(Executive_3D_Group__c next:[Select Name, Group_Number__c, Season__c, Active__c from Executive_3D_Group__c where
Group_Number__c = :this.currentGrpNumber AND Season__c = :(this.currentGrpSeason + 1) limit 1]){
String activeName = 'Group ' + this.currentGrpNumber + ' - Active';
next.Name = activeName;
next.Active__c = true;
update next;
}
Hi,
only method does not show correct line of error.
However, viewing the code shows that the exception might be at line
String updatedOldGrpName = 'Group ' + this.currentGrpNumber.intvalue() + ' - Season ' + this.currentGrpSeason.intvalue();
The reason is that the value this.currentGrpNumber or this.currentGrpSeason is null. You have to handle null cases.
You can write something as
if(this.currentGrpNumber != null){
// do your stuff
}....etc
with best,
crmtech
If the problem is still not resolved can you please provide a bit more code snippets, or just highlight the code line which is causing error.