function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kirankumarreddy punurukirankumarreddy punuru 

Developer script exception

Hi ,
I got a email from ApexApplication [mailto:info@salesforce.com] saying that:: Developer script exception from eClerx : OLITrigger : OLITrigger: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object Class.OLIHelper.annualEmergingClientCalculator: line 78, column 1 Class.OLIHelper
Apex script unhandled trigger exception by user/organization

OLITrigger: execution of AfterUpdate
 
caused by: System.NullPointerException: Attempt to de-reference a null object
 
Class.OLIHelper.annualEmergingClientCalculator: line 78, column 1
Class.OLIHelper.callFormulae: line 128, column 1
Class.OLIHelper.ProductSalesPriceUpdator: line 1178, column 1
Trigger.OLITrigger: line 87, column 

We have checked the code and added the null checks but still it sending this email can some one tell me the root cause for this error.

Thanks,
Kiran Kumar
AnjithKumarAnjithKumar
Hi Kiran,

This is causing when OLI updating. Share the code if you need help.
RAM AnisettiRAM Anisetti
You need to check null condition before doing DML operations of Sobject.
 
Case 1)
Account a=[select id,name from Account where name like '%Ram%' limit 1];
//update will fire only "a" having value
if(a!=null){
update a;
}

​Case 2)
List<Account> alist=[select id,name from Account where name like '%Ram%' ];
//update will fire only "alist" having values
if(alist.size()>0){
update alist;
}