You need to sign in to do that
Don't have an account?
error explanation for Testclasses
@isTest
private class GoalControllerTest {
static Account acc;
public static void testData(){
acc=new Account(LastName='ABC',FirstName='PQR',RecordTypeId='01220000000DnK3AAK');
upsert acc;
system.assertNotEquals(null,acc);
Entity_Global_Assumption__c ega=new Entity_Global_Assumption__c(Account__c=acc.id,Expected_Return_on_Investment__c=30,Income_Growth_Rate__c=3,Inflation_Rate__c=6,Number_Of_Months__c=5);
upsert ega;
system.assertNotEquals(null,ega.id);
i am placeing a piece of my code that gives an error
System.nullpointer Exception Attempt to derefrence null object
what could be the possible reason for that
so where should i check
is there any specific reason that you are creating a static variable?
if not, then change your code to:
i think information if you can post the complete code and error then its easy to track.. from the above code i can't understand how u r creating an account with the fields lastname and firstname.. those are not in account right?....