Created
December 6, 2018 16:36
-
-
Save mephistoc/2903b992f8ece71732f1d9c8109ce182 to your computer and use it in GitHub Desktop.
Trigger an Auto Lookup every 10 seconds in eForm #AgilePoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Auto trigger an Auto Lookup every 10 seconds. | |
* 2018-Dec-07, Vincent Chu, AgilePoint Taiwan | |
*/ | |
// Wire round-robin schedule on form load completed. | |
eFormEvents.onFormLoadComplete = function () | |
{ | |
setInterval(TriggerPIRAutoLookup, 10000); | |
} | |
function TriggerPIRAutoLookup(){ | |
var options = {fieldId: 'ReadFrontDoorPIR'}; | |
var fieldOpts = {fieldId: 'FakeParameter'}; | |
// Modify hidden field which been use as fake parameter to the Auto Lookup which will be trigger. | |
// Same Auto Lookup won't be trigger, so it would need to make some difference. | |
eFormHelper.getFieldValue(fieldOpts, function(res){ | |
eFormHelper.setFieldValue({fieldId: 'FakeParameter', value: res.data += 1}, function(resres){ | |
debugger; | |
console.log(resres); | |
}); | |
}); | |
eFormHelper.triggerAutoLookup(options, function(result){ | |
if (result.isSuccess){ | |
console.log(result.data); //logs the data holds the empty object | |
} | |
else{ | |
console.log(result.error); // logs the hold exception object | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment