You need to sign in to do that
Don't have an account?
Sarath C R
Please help me out with this
error::::'System.NullPointerException: Attempt to de-reference a null object'
Class.massUpdateLeadController.<init>: line 7, column 1
Please check the following class
public with sharing class massUpdateLeadController {
public List<Lead> Leadlst;
list<Id> lstId = new List<id>();
public Lead lead{get;set;}
public massUpdateLeadController(ApexPages.StandardController sc) {
lead = (Lead)sc.getRecord();
lstId = ApexPages.currentPage().getParameters().get('recs').split(',',-2);
leadlst = [select id, Industry from Lead where Id In : lstId];
}
public pagereference updateLeads(){
for(Lead l: Leadlst){
l.Industry = lead.Industry;
}
update Leadlst;
pagereference pg = new pagereference('/00Q/o');
return pg;
}
public pagereference cancel(){
pagereference pg = new pagereference('/00Q/o');
return pg; }
}
Class.massUpdateLeadController.<init>: line 7, column 1
Please check the following class
public with sharing class massUpdateLeadController {
public List<Lead> Leadlst;
list<Id> lstId = new List<id>();
public Lead lead{get;set;}
public massUpdateLeadController(ApexPages.StandardController sc) {
lead = (Lead)sc.getRecord();
lstId = ApexPages.currentPage().getParameters().get('recs').split(',',-2);
leadlst = [select id, Industry from Lead where Id In : lstId];
}
public pagereference updateLeads(){
for(Lead l: Leadlst){
l.Industry = lead.Industry;
}
update Leadlst;
pagereference pg = new pagereference('/00Q/o');
return pg;
}
public pagereference cancel(){
pagereference pg = new pagereference('/00Q/o');
return pg; }
}
Looks like the 'recs' parameter is not set in your URL.
You should add null checking around line 7. For example: