Umar Naeem
10/03/2022, 10:05 AMbattk
10/03/2022, 5:44 PMUmar Naeem
10/06/2022, 4:30 AMsomeFunctionReturningPromise().then(result => {
const fileObj = file.load({id: FILE_ID})
})
This was returning error.
However, if I load the file outside the promise, it was working fine.battk
10/06/2022, 4:56 AM/**
* @NApiVersion 2.1
* @NScriptType Suitelet
*/
define(["N/file"], function (file) {
return {
onRequest: function (context) {
Promise.resolve()
.then((result) => {
const fileObj = file.load({ id: "83" });
})
.catch((e) => {
log.error("e", e);
});
},
};
});
battk
10/06/2022, 5:09 AM