This code below actually doesn't work as it stands, but if you look at what I am trying to do, I was curious if, in general, this is possible (my syntax is off I'm sure)? Mainly, can I create a query object that is equal to my resource query that I want to run, i.e., the 'queryCurrent' variable used in three places after declared. Trying to avoid using eval().
Thanks!
const run = async () => {
let queryCurrent = queryUpdateApp();
// Inititalize Runtime
var startTime = performance.now();
variableQueryRuntime.setValue(performance.now());
variableQueryDefinition.setValue(queryCurrent.query);
variableQueryName.setValue(queryCurrent.id);
// Query Trigger Code
queryCurrent.trigger({
// Success Code
onSuccess: function() {
// On Success Query
queryOnSuccess.trigger({
// On Success Code
onSuccess: function() {
// Insert Message Code
queryInsertMessageJS.trigger();
}
});
},
// Failure Code
onFailure: function() {
// On Failure Query
queryOnFailure.trigger();
}
}).then(
// Record Runtime
variableQueryRuntime.setValue(performance.now()-startTime)
);
return queryCurrent;
}
run();