Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

PapaParse - How to ensure Chunks processed in sequence. Apex response need to fire the next processing sequence

Asked by Ankur Vaish Jul 12, 2021 1.6K views 1 answer
Share

About this question

How can I ensure when the first Chunk is inserted in SF then need to fire the second chunk to make sure of sequential processing? I am able to chunk the records in SF and format accordingly but need to insert records in chunks as I process at the client side in sequence.

Papa.parse(file, { worker: true, chunkSize: 1024 * 5, chunk: function (results) { this.papaRecords = results.data; let lstCCToInsert = []; var obj = {}; obj = this.papaRecords; lstCCToInsert.push(obj); RecordInsertJob({ lstCCToInsert: lstCCToInsert, }) .then(result => { thiss.status = result; // when first Chunk inserted in SF then need to fire second chunk ? }) .catch((error) => { }); }, complete: function () { console.log('Complete'); } });

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.