I am trying to update the Description for over 200 Account entities by matching on Salesforce Id. I am using the following trigger ,
Trigger MyNew_tr_U on Account (after update) {
set<ID> ids = Trigger.newMap.keyset();
for(ID id : ids)
{
newChangeTable__c ch = new newChangeTable__c();
ch.Status__c = 'update';
ch.Url__c = id;
ch.Process__c = false;
insert ch;
}
}
but when i do the data Import of the csv file i get the following error:
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:MyNew_tr_U: execution of AfterUpdate
caused by: System.DmlException: Insert failed. First exception on row 0; first error:
STORAGE_LIMIT_EXCEEDED, storage limit exceeded: []
How can i get the trigger to work ?
Further to @eyescream answer below. What if I have no filter as in Name, that gives the same error.
Trigger MyNew_tr_U on Account (after update) { List<newChangeTable__c> toInsert = new List<newChangeTable__c>();
for(Account a : trigger.new){
Account old = trigger.oldMap.get(a.Id);
toInsert.add(new newChangeTable__c(
Status__c = 'update',
Url__c = a.Id,
Process__c = false
));
}
insert toInsert;
}
You're running out of database space. Go to Setup -> Storage Usage and have a look. Maybe you can delete something, maybe (if it's production) you can buy more storage from SF (there are "data packs" 10 GB each or you get some more storage with every user license you buy). That works only in productions, sandboxes have fixed size though so your only way is to delete some old stuff.
As for the trigger itself...
Something like this, it inserts your thing only if Name changed.