vincentkang
10/04/2022, 6:23 PMsavedSearch.runPaged({pageSize}) and pageRangees.forEach
However, due to the savedSearch calculating the fields upon request is made, it is timing out when there is more than 20k records… and I have heard that suiteQL and runSuiteQLPaged have a better performance.
var results = query.runSuiteQLPaged({
query: 'SELECT customer.entityid, customer.email FROM customer',
pageSize: 10
});
in the docs, it is using customer
as a table name. If I want to query a savedSearch, what should the table name be? I tried with the savedSearch id but my restlet does understand what savedSearch I am trying to query.Shawn Talbert
10/04/2022, 6:33 PMSandii
10/04/2022, 7:59 PMvincentkang
10/04/2022, 8:00 PMscottvonduhn
10/04/2022, 8:15 PMvincentkang
10/04/2022, 8:20 PMscottvonduhn
10/04/2022, 8:23 PMvincentkang
10/04/2022, 8:52 PMpageData.fetch.promise({index: pageIndex}).then(res => res).catch(err => err)
does not execute anything and returns null… but at least i got more understanding of suiteQL. 🙂scottvonduhn
10/04/2022, 8:53 PMscottvonduhn
10/04/2022, 11:05 PMvincentkang
10/04/2022, 11:07 PMN/search PagedData.fetch
.
but it does not work… the program execution does not go into then nor catch clause…
https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4491674556.htmlvincentkang
10/04/2022, 11:11 PMdefine(['N/log'],
(log) => {
const request = () => {
return new Promise((resolve) =>
setTimeout(() => resolve({status: 'done'}), 2000)
)
}
const get = (event) => {
request()
.then(r => {
console.log("@@ resolved", r)
return r;
})
.catch(err => {
console.log("@@ catch", err)
})
return 123;
};
return {
get
};
}
);
I see that suiteScript 2.1 has native javascript Promise. I ran it locally and worked.
But on the netsuite, it does not throw an error. And ignores my promise function and then/catch….
Do you have any idea?scottvonduhn
10/04/2022, 11:18 PMscottvonduhn
10/04/2022, 11:19 PMscottvonduhn
10/04/2022, 11:22 PMscottvonduhn
10/04/2022, 11:25 PMvincentkang
10/04/2022, 11:56 PMpageData.fetch()
it times out. there is not a lot of records in the savedSearch. but the savedSearch structure is a bit complex.
when I used pageData.fetch.promise()
to get data from savedSearch, it returns absolutely nothing… the program just ignores the promise.vincentkang
10/04/2022, 11:57 PMscottvonduhn
10/04/2022, 11:57 PMscottvonduhn
10/05/2022, 12:00 AMvincentkang
10/05/2022, 12:00 AMscottvonduhn
10/05/2022, 12:01 AMvincentkang
10/05/2022, 12:02 AMscottvonduhn
10/05/2022, 12:02 AMvincentkang
10/05/2022, 12:03 AMscottvonduhn
10/05/2022, 12:03 AMvincentkang
10/05/2022, 12:03 AMscottvonduhn
10/05/2022, 12:04 AMvincentkang
10/05/2022, 12:05 AMscottvonduhn
10/05/2022, 12:05 AMscottvonduhn
10/05/2022, 12:06 AMvincentkang
10/05/2022, 12:06 AMscottvonduhn
10/05/2022, 12:06 AMscottvonduhn
10/05/2022, 12:07 AMvincentkang
10/05/2022, 12:09 AM