Why I am getting 'TOO MANY DML STATEMENTS ERROR IN THIS LINE?'
Note: Class is auraenabled(cacheable =true)
List<ABC> obj1 = new List<ABC>(); for (ABC A1 : [SELECT ID,field1, field2, field3, (SELECT Id, Name,ParentId,CreatedDate FROM Attachments WHERE Name LIKE 'something' ORDER BY CreatedDate DESC Limit 1) FROM ABC WHERE field5ID = 'field5ID' ORDER BY field1]) { if(!A1.Attachments.isEmpty()) { for (Attachment Att : A1.Attachments) { MAP1.put(A1.field1,A1.Id); if(A1.field2 = true){ A1.field2 = false; Obj1.add(A1) ; } } } } if(Obj1.size() > 0){ update Obj1; //GETTING ERROR ON THIS LINE } 0 Related questions 0 Update is not a function mongoose 0 How to update data in multiple objects at the same time using same method in firebase? 288 ReactJS: Maximum update depth exceeded error Related questions 0 Update is not a function mongoose 0 How to update data in multiple objects at the same time using same method in firebase? 288 ReactJS: Maximum update depth exceeded error 1 Property 'update' and 'quantity' doesn't exist on type '{ }' 0 Trouble in reactjs Update operation 2 Update Many with mongoose - Array of update objects 0 Update Information Using DML in Aura 1 ReactJS - Maximum update depth exceeded error 0 LWC, set record to database soql from JavaScript with wire and Apex, error 0 Maximum update depth exceeded error in react app Load 7 more related questions Show fewer related questions Reset to default