I have a requirement to save models automatically every 5mins. I tried to create settimeout function. But in the latest version, the JS Inline snippet doesn’t trigger on page load. Is there any other options?
I use this online snippet on a V1 page to requery a model every 5 seconds. Has worked perfectly for a couple years. You have to call it from an action. I use on on page render action sequence to launch it.
// To be used as an inline snippet
var model = skuid.$M(‘INSERT_YOUR_MODEL_NAME_HERE’),
refreshInSeconds = 5;
if (model) setInterval(function () {
model.updateData();
}, refreshInSeconds * 1000);
Your snippet is triggered only when a page loaded correct? My requirement is to trigger the snippet every 5 mins.
Page render action triggers the snippet to run. The snippet has a loop built in that continuously runs at the designated interval so it would accomplish what you are looking for.
We published an example snippet for periodic reloading of a page’s model in our Skuid Labs repository. Check it out here:
github.com
skuid-labs/experiments/snippets/realTimeOppDashboard at master ·...
master/experiments/snippets/realTimeOppDashboard
A place for the Skuid community to share custom components, formulas, and other extensions - skuid-labs/experiments/snippets/realTimeOppDashboard at master · skuid/skuid-labs
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.