Custom types availability serverless app

We are using a serverless app to catch data from custom_fields.

However, we a re not sure if the data has time to be populated, hence we wrapped the function with setTimeout like this:

 onTicketCreateHandler: async function (args) {
    await setTimeout(aMethodToPerformBusinessLogic(args), 2000);
  }

However, this isn´t appear to be working which seems rather odd to me as setTimeout is a global node.js class(for my understanding

1 Like

Hello @ansfs91,
I tried replicating the same issue at my end and found setTimeout is undefined and later found out in the documentation here that,

The serverless component of the app is executed in sandbox mode where some methods, such as setTimeout and setInterval, cannot be used.

Please refer to documentation page here: Overview

Thanks!

2 Likes

Thanks Kunal

& regarding the custom_fields value?
When triggered from a WFA, is the value ready when the app starts or not?

Please forgive my ignorance, But can you please elaborate.
I have some quesions.

  • Are you using Entity Storage Custom Objects?
  • Can you please share what you are referring to as WFA?
  • Can you please share the code snippet or App zip file so that I can reproduce the same at my end?

Thanks

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.