Hi All. We are trying to get the data using restle...
# general
p
Hi All. We are trying to get the data using restlets and record module. Record module’s load method is taking a lot of time for us. We tried recordModule.load.promise() but it fails with “Promise” is not defined error. Please help.
s
In general, unless you need to make updates to a record and save them, or you need a workflow or user event script to trigger, then it's not worth using record.load as it does take a while. Saved searches or queries using N/search or N/query will retrieve data much faster, and can be targeted to just the fields you need. Promises won't help in a server-side script, as their only purpose is to make things asynchronous. They can't speed up the API calls. They are meant for client side scripting to make the user experience more responsive (scripts aren't blocking while waiting for function calls to return).
p
Thanks a lot for your response. We are using recordmodule as it creates the hierarchy (e.g. invoice, invoice line items and links). If we have to go for N/search and N/query, we will have to create it ourselves.
Also thanks for confirming the second part.