Skip to content

Instantly share code, notes, and snippets.

@wave-inguane
Created Aug 3, 2021
Embed
What would you like to do?
spUtil
//A simple recordWatch function.
spUtil.recordWatch($scope, "live_profile", "sys_id=" + liveProfileId);
//In a widget client script
function(spUtil, $scope) {
/* widget controller */
var c =this;
// Registers a listener on the incident table with the filter active=true,
// meaning that whenever something changes on that table with that filter,
// the callback function is executed.
// The callback function takes a single parameter 'response', which contains
// the property 'data'. The 'data' property contains information about the changed record.
spUtil.recordWatch($scope, "incident", "active=true", function(response) {
// Returns the data inserted or updated on the table
console.log(response.data);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment