• Narendra Varma A
  • NEWBIE
  • -1 Points
  • Member since 2015


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
HI All,

i have written the below trigger to populate a number field No_of_updates__c with the number of time a record is updated, but i am getting a Null pointer exception when a try a update a record. can anybody help me with this issue.

trigger
================================

trigger updatecount on Account (after update) {
if(trigger.isupdate)
{
updatecountAcct.countnumber(trigger.new);
}
}
=================================================

Helper class
=================================================
public class updatecountAcct {
public static void countnumber(list<account> a)
{
list<account> c= new list<account>();
    for(account b : a)
    {
    b.No_of_updates__c=b.No_of_updates__c+1;
    c.add(b);
    }
    update c;
    }
}
=====================================================
 

Hi Board,

I'm facing a issue in trigger where in i'm trying to perform a dml statement using List<sObject>.

It throws exception for me when i have more then 900 records in my list.

Error message is stated below:

System.TypeException: Cannot have more than 10 chunks in a single operation. Please rearrange the data to reduce chunking.