Contract Management - Renew Modal - Renewal_option choices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Within the Contract management module we are adding some additional options to the Renewal Options field.
We have added a new choice of 5 years to the dictionary, and updated the relevant UI Page (contract_renew_popup) for this modal to show the new option.
Everything is looking and working as expected in native UI view:
but when looking at the same contract in the Hardware Asset Workspace - the modal has the new '5 Years' option not in the correct order:
Can anyone help me with this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Updating the sequence to 4 (or to highest value in choices) for the new 5 years sys_choice in the dictionary will likely do the trick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks, It is already set to 4 but still not showing in as the last option in the Workspace view of the Renew Modal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Checked this in the ham simulator learning course on xanadu and sn_itam_workspace v 6.0.1
This here is the data resource that provides the options
https://[instance].service-now.com/nav_to.do?uri=sys_ux_data_broker_transform.do?sys_id=b09aa0fda3b1011021fd885716fcda14
This is the script include that the data resource uses
https://[instance].service-now.com/nav_to.do?uri=sys_script_include.do?sys_id=c86a8b6b531170103676ddeeff7b123e
The data resource just returns an array with whatever ordering the gliderecord/glidequery defaults to on the sys_choice table. Mine was different to your screenshot. Best way to fix is straight at the source by adding an order by sequence in the query in the script include.
var AssetWorkspaceUtil = Class.create();
AssetWorkspaceUtil.prototype = {
....
getRenewOptions: function () {
var current_language = AssetWorkspaceUtil.getSessionLanguage();
var results = [];
results.push({
id: 'none',
value: '',
label: gs.getMessage('-- None --'),
});
new global.GlideQuery('sys_choice')
.orderBy("sequence") // << add order by sequence
.where('name', 'ast_contract')
.where('element', 'renewal_options')
.where('language', current_language)
.select('value', 'sys_id', 'label')
.forEach(function (option) {
var options = {};
options.id = option.value;
options.value = option.value;
options.label = option.label;
results.push(options);
});
return results;
},
