Title not working in the "Data Table from Instance Definition" widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2017 09:13 PM
Hello experts,
I am using Data Table Instance Definition wigdet to show the information of Incident.
I have set the title as 'My BDC Resolved Incidents' but it showing as Incident only.How can I change it?
Thanks
saranya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 10:31 AM
I found the bug that causes this issue.
The Data Table widget HTML gets the title from whatever is put into data.title, but if that is empty or undefined then it will get the title from data.table_plural (the plural label of your table):
<span class="panel-title"><i ng-if="options.glyph" class="fa fa-{{options.glyph}} m-r"></i>{{data.title || data.table_plural}}</span>
If you set the Title in the widget instance options, you will notice on page load that the widget title is correctly displayed for a second or two, before reverting back to the plural table label. This is because on page load, the client controller in the Data Table widget correctly sets data.title from options.title (your instance option), and then posts to the server. When the server returns to the client, the callback function for some reason resets data.title to the variable title. The problem is that the title variable is now undefined in this callback function. Therefore, the HTML is forced to grab the table label from data.table_plural (which was defined in the server script), since data.title is now invalid.
Here is the code from the Client Controller that is causing the issue (ln.244 in Jakarta, ln.192 in Istanbul):
// Makes Widget Async
var title = $scope.data.title;
if ($scope.options.use_instance_title == 'true')
title = $scope.options.title;
$scope.data = $scope.options;
$scope.loadingData = true;
$scope.server.update().then(function() {
if ($scope.data.newButtonUnsupported)
console.log("Service Portal: New button not supported for sys_attachment list");
$scope.loadingData = false;
$scope.data.title = title;
initRecordWatcher($scope.data.table, $scope.data.filter);
});
Ln.11 in this snippet $scope.data.title = title; is resetting data.title to an undefined value, as title is undefined in the callback function. Simply comment out this line, or set $scope.data.title = $scope.options.title instead (Note: you will have to copy the OOB Data Table widget to edit it, and do the same for Data Table from Instance Definition/URL widgets so that they can invoke this new Data Table widget).
I have seen this bug in both Istanbul and Jakarta.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2018 10:41 AM
Thanks lexifouts for the detailed explanation of the bug and how to resolve. This saved me many, valuable hours trying to resolve this issue. Thanks so much!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2022 11:31 AM
Go to Data Table from instance and on the server script add this :
Go to Line 50>> options.useInstanceTitle = true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2023 03:16 AM
how do i know where to add it in the server script ?