• Brice VEZIN
  • NEWBIE
  • 0 Points
  • Member since 2015
  • CRM Consultant
  • Nova Technologies


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,

I have a following method where i am getting

System.null pointer exception : attempt to dereference a null object


Kindly help me how to fix it

This is my method where error occurs
METHOD :

public void CallPremisysQuote(Team_Form__c so)
			{ 
				
				list<Team_Form__c>lstTF = [select ID,Engagement_Script__r.GPS_VRD_Customer__c from Team_Form__c where Id = :so.Id];
				if(TFIdPSQuoteMap.get(so.Id)!= null && TFIdPSQuoteMap.get(so.Id).size()>0)
				{
					PremisysQuoteExist= True;      
				}
				
				if(so.Status__c=='Released to Sales')
				{
					
					if(!PremisysQuoteExist)
					{
						if(lstTF[0].Engagement_Script__r.GPS_VRD_Customer__c.touppercase() == 'NO'){
							
							if(so.PS_Engagement_Type__c=='New Order')
							{ 
								
								GPS_Premisys_CreateQuote.fnCreatePremisysQuote(so.Id);
							}
							
							else
							{
								if(so.GPS_Price_Impacting__c=='Yes')
								{
									
									GPS_Premisys_CreateQuote.fnCreatePremisysQuote(so.Id);                 
								}              
								
							}
						}
                /*else{
so.addError('PremiSys quote cannot be created for VRD customers. The sales team has chosen this option on the Engagement Script');        
}*/
            }      
        }

Kindly help me pls

Thanks in Advance