raghav
05/17/2024, 5:34 AMconst processMsg = message.create({
title: 'Processing',
message: 'Updating records.',
type: message.Type.INFORMATION
})
const successMsg = message.create({
title: 'Success',
message: 'Records have been successfully updated.',
type: message.Type.CONFIRMATION
})
processMsg.show()
// getting the data from the body level fields and itterating the sublist and updating the records.
processMsg.hide()
successMsg.show()
This above code updates all the records.
Then display both the messages instead of displaying the processMsg first and then hiding it and displaying the successMsg.
I know its due to asynchronous nature of js, but how can I resolve this?battk
05/17/2024, 7:50 AMraghav
05/17/2024, 8:01 AMstartTime = new Date()
SetTimeout(2000)
endTime = new Date()
console.log(endTime-startTime)
The above resulted in some 10ms delay instead of 2000.battk
05/17/2024, 8:02 AMraghav
05/17/2024, 8:03 AM