Hi,
I wrote a little script who :
1/ Delete some records of the table tableSuiviFacturation
while (recordToDelete.length > 0) {
await tableSuiviFacturation.deleteRecordsAsync(recordToDelete.slice(0, 50));
recordToDelete = recordToDelete.slice(50);
}
2/ Insert some new recors in this table :
await tableSuiviFacturation.createRecordAsync({
"Client" : [{id: clientsID[item]}],
"Période" : Periode,
"Solde début période" : montantDernierSoldelitem],
.........
And I 've a error
SyntaxError: await is only valid in async functions and the top level bodies of modules
If I remove the await, the error disappears but I don’t understand why ?!!