Visitor
gApps
Posts: 1
Re: System.NullPointerException: Attempt to de-reference a null object
[ Edited ]
In your intial query, you should also exclude null values in the fields. Something like this:

OpportunityLineItem[] technologyentry = [Select PricebookEntry.ProductCode, PricebookEntry.Name, Mix__c , OpportunityId From OpportunityLineItem  where OpportunityId in: opptyIds

and <possible null field> != null

 order by Mix__c DESC];

Also, if/when you use relationships in your query, do it once for the parent and once for the child.


Message Edited by gApps on 06-24-2008 09:47 AM

Message Edited by gApps on 06-24-2008 09:47 AM