Service Portal Widget Server Script Timeout

b_felinksyi
Tera Contributor

Hi Everyone,

I'm trying to query and get a large amount data (around 30k of records) from the table using GlideRecord in Server Side in the widget. But seems there is some timeout for widgets server side scripts. It send me "failed to load resource: the server responded with a status of 500 (Internal Server Error)" in browser console after 300 sec.

This script in background script completes succesfully (after 380 sec).

Tried to move logic in script include, but the same result.

Perhaps there is some solution?

Thanks for answers!

1 REPLY 1

bbarber9
Giga Expert

Is there a reason you need all 30K records at once? You may want to consider breaking it down/paginating. In any case, you could try using the table REST API instead of querying in the server script. This would be done asynchronously in the client script. You can inject $http into your widget's client script function to make the process a little easier.

Documentation on $http

Documentation on Table API