- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 12:59 AM
Hi,
I have made a custom widget and used in catalog which shows the records I want that whenever the user clicks the record that record should open in new tab in native servicenow.
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 02:51 AM
Duplicate of this: Data table widget using macro variable
Solution for this is (make sure to add $window to the function declaration of the client controller):
$scope.$on('data_table.click', function (event, params) {
$window.open('nav_to.do?uri=%2F' + params.table + '.do%3Fsys_id%3D' + params.sys_id, "_blank");
});

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 01:17 AM
Hey,
Check below article and go through all responses.
service portal: data table widget form redirection
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 02:52 AM
This wont work as you do not have any instance options available when using a custom widget in a service catalog item...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 01:39 AM
Hello,
Not sure which code you are using, please check below piece of HTML code if it helps you.
<tr ng-repeat="item in data.list track by item.sys_id">
<td role="{{$first ? 'rowheader' : 'cell'}}" class="pointer sp-list-cell" ng-class="{selected: item.selected}"
ng-click="go(item.targetTable, item)"
ng-repeat="field in ::data.fields_array"
data-field="{{::field}}"
data-th="{{::data.column_labels[field]}}">
<a href="javascript:void(0)" ng-if="$first" aria-label="${Open record}: {{::item[field].display_value}}">{{::item[field].display_value | limitTo : item[field].limit}}{{::item[field].display_value.length > item[field].limit ? '...' : ''}}</a>
<span ng-if="!$first">{{::item[field].display_value | limitTo : item[field].limit}}{{::item[field].display_value.length > item[field].limit ? '...' : ''}}</span>
</td>
</tr>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 02:51 AM
Duplicate of this: Data table widget using macro variable
Solution for this is (make sure to add $window to the function declaration of the client controller):
$scope.$on('data_table.click', function (event, params) {
$window.open('nav_to.do?uri=%2F' + params.table + '.do%3Fsys_id%3D' + params.sys_id, "_blank");
});