You need to sign in to do that
Don't have an account?

How to chain server calls synchronously in lightning web components
Hi All,
I have requirement where user have to process multiple records each at a time due to governor limitations.
For the incoming multiple records each record is taken and calls apex. After the successful response have to place the same request again. Like so to process all records.
Can someone help me how to achieve this.
Thanks in advance.
Naveen Mallepalli.
I have requirement where user have to process multiple records each at a time due to governor limitations.
For the incoming multiple records each record is taken and calls apex. After the successful response have to place the same request again. Like so to process all records.
Can someone help me how to achieve this.
import { LightningElement, api, wire, track } from 'lwc'; import createRecord from '@salesforce/apex/OpportunityLoadController.createRecord'; export default class OpportunityLoadLWC extends LightningElement { @api error; @api resultLst = []; @api message; // //Other logic // handleClick(e) { var oneRecord = resultLst.pop(); createRecord({ data : oneRecord }) .then((result) => { //call createRecord again }) .catch((error) => { this.message = 'Error received: code' + error.errorCode + ', ' + 'message ' + error.body.message; }); } }
Thanks in advance.
Naveen Mallepalli.