You need to sign in to do that
Don't have an account?

attempt to de-reference a null object
I am receiving the following error. I have included the code after the error. Any help would be appreciated.
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger ContactOpportunityStage caused an unexpected exception, contact your administrator: ContactOpportunityStage: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.ContactOpportunityStage: line 13, column 1
trigger ContactOpportunityStage on Opportunity (after insert, before update) {
SingletonResource singleton = SingletonResource.getInstance();
Stage_And_Status__c oppStages = Stage_And_Status__c.getInstance('Opportunity Stages');
Stage_And_Status__c contactStatuses = Stage_And_Status__c.getInstance('Contact Statuses');
// Opportunity stages
Map<String, Integer> oppStageMap = new Map<String, Integer> { /////LINE 13
oppStages.Open_Meeting__c => 1,
oppStages.Closed_Meeting_Withdrew__c => 2,
oppStages.Closed_Meeting_AMPF_Declined__c => 3,
oppStages.Open_Due_Diligence__c => 4,
oppStages.Closed_DD_Withdrew__c => 5,
oppStages.Closed_DD_Background__c => 6,
oppStages.Closed_DD_Hiring_Mgr__c => 7,
oppStages.Closed_DD_Governance__c => 8,
oppStages.Open_Offer_Extended__c => 9,
oppStages.Closed_Offer_Declined__c => 10,
oppStages.Closed_Offer_Expired__c => 11,
oppStages.Closed_Offer_Accepted__c => 12
//oppStages.Open_Offer_Generation__c => 3,
// oppStages.Open_Offer_Accepted__c => 12,
//oppStages.Closed_Won_Hired__c => 13
};
This suggests that oppStages is null - I'd add some debug to dump out the setting once you've retrieved it.
yes oppstages is null ...but I am not sure why?