HI I am trying to delete bulk custom records using...
# suitescript
d
HI I am trying to delete bulk custom records using Map Reduce Script, Reduce function() Reduce function make a search n gets the records which needs to be deleted for (var index = 0; index < arrayChildRecords.length; index++) {                                     try{                                     deleteRec(arrayChildRecords[index])                                     }catch(e){                                         log.error({                                             title: "error Occuered",                                             details: e.toString()                                         })                                     }                                 } I am getting USAGE LIMIT EXCEEDED issue here, i was expecting it to yield automatically , but it failed to yield ? Do i need to add any logic to yield?
s
are you using suitescript 2.0?
d
Yup
study this if still some issues you may let me know in private message
b
Every entry point in map reduce has a limited amount of points
You are supposed to divide up your data using getInputData or map or reduce in such a way that the next entry point will not run out of points
👍 1
e
Have you tried mass update scripts to do bulk deletion?
d
@Eric B yup finally i have used mass update script to do bulk deletions, but still checking it out in mr for yield purpose
@Salman Afzal link doesnot work
e
@D17339 I’ve been down the same road of trying an MR script approach and performance has not been great and usage limits are always exceeded for the most part. Mass update solved all these issues for me.
✔️ 1