issues with spUtil.recordwatch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 12:46 PM
I'm trying to use spUtil.recordWatch to update a widget. My client script looks like this:
function($scope, $sce, spUtil, $timeout, $window, spModal, $location, spHRService, $rootScope, nowServer, $http, $uibModal, $mdDialog) {
/* widget controller */
var c = this;
c.server.get({
action: 'retrieve_data'
}).then(function(response) {
c.data.loading = false;
$scope.active_tasks = [];
$scope.active_workflow = '';
//Get link data
c.stage = response.data.stage;
c.currentOrder = response.data.currentOrder;
$scope.tasksDiv = false;
});
spUtil.recordWatch($scope, 'my_Tasks', "", function(name,data) {
spUtil.update($scope);
});
My recordWatch code above does nothing in terms of updating the widget, is there something I'm doing wrong or missing?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 01:55 PM
So is the table really "my_Tasks"?
Seems like it should be u_my_tasks, unless you made it in scope, but then it would be x_1111_my_tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 02:37 PM
hi Jace, the table name is in our own scope so it's actually x_dnf_task, but i just put my_Tasks as an example. In my code, I have the correct table name in there and it still doesn't work. Any suggestions?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 02:43 PM
I think all you need is this. spUtil.update($scope); not required
spUtil.recordWatch($scope,'x_dnf_task','');
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2018 02:41 PM
Dear David,
Can you try without the callback and see if it works, also as Jace mentioned pls check the table name once and see if it is correct.
spUtil.recordWatch($scope, 'my_Tasks', '');
below is a sample client script that I tried and it works fine.
function(spUtil, $scope) {
/* widget controller */
var c = this;
spUtil.recordWatch($scope, 'incident', '');
}
Thanks
Anil