Re: System.Nul lPointerEx ception: Attempt to de-referen ce a null object
[ Edited ]
06-24-2008 09:26 AM - last edited on 06-24-2008 09:47 AM
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
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
