• S__
  • 0 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 1

Hi Guys,


I have two objects Target List and Selling Area. Also have Target List Member object as junction of both. User can create target list and add selling area based on some search criteria. I am storing that SOQL in query field of Target List. Overnight batch to run through all target list get the query and iterate over query result and insert Target List Member records. But Batch class gives me Too Many DML rows error while insertion.


I am testing this with 4 target lists Each of them have separate query. These quries return 2764 records of selling area. Means 2764*4 target list members.  Now requirement is one target list can have up to 50K-80K selling area, so setting scope to 1 won't solve my problem. Any suggestion or workaround?