is there away in client script for function to run...
# suitescript
s
is there away in client script for function to run only after message disappear using "N/ui/message"
Copy code
.then(please rub this )
b
s
tried that doesnt seem to help
b
what was your code
s
Copy code
function _shipnow(sciptcontext) {
    var myMsg = message.create({
      title: "Action",
      message: "You transfer order was marked shipped and will be received.",
      type: message.Type.INFORMATION,
    });
    // will disappear after 5s
    myMsg.show({ duration: 1500 });
    setTimeout(loadshipped(), 2000);
the console.log hit before the message shows
b
the first parameter to setTimeout is supposed to be a function
what does loadshipped() return?
s
that will only run after the timer expires
it is all the bussniess logic and it doesnt return anything
b
not the way you wrote it, the () after loadshipped runs the function immediately
so you run loadShipped early and the setTimeout does nothing
s
lol I missed that , oops
another question if my script was transforming the transaction to IR
Copy code
var IR = record.transform({
        fromType: "transferorder",
        fromId: Toid,
        toType: "itemreceipt",
        defaultValues: {},
      });
do i have to check to make sure it wasn't received yet , if so do i call record. Load and then check
@battk
b
i mean you should
if there is nothing to receive you will get an error
s
doesnt this slow down the script
b
its why i said you should