How to pass sys_id to script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2024 02:24 AM
Hello,
I'm leveraging one OOTB functionality but couldn't able to achieve the requirement. We have Add Ui action on incident which will help to add more incidents on a single go. Following is the problem record, In which I can add number of incidents at a time to the problem record.
But I'm unable to find the UI page in our instance.
I tried to replicate the same by creating two other tables.
Here is my UI action:
Add -- Client side -->
Below is my script:
function openVenueList(){
var gajax = new GlideAjax("x_564970_games_sam.BulkAddVenues");
gajax.addParam("sysparm_name","getURL");
gajax.addParam("sysparm_sys_id", g_form.getUniqueValue());
gajax.addParam("sysparm_parent_table", g_form.getTableName());
gajax.getXMLAnswer(openListModalIncident);
}
function openListModalIncident(url){
var incModal = new GlideModal('add_child_cases_to_parent');
incModal.setTitle(getMessage("Add Venues"));
incModal.setWidth(1200);
incModal.setAutoFullHeight(true);
incModal.on('beforeclose', function(){
refreshRelatedIncidents();
});
ScriptLoader.getScripts('/scripts/incident/glide_modal_accessibility.js', function() {
incModal.template = glideModalTemplate;
incModal.renderIframe(url, function(event) {
glideModalKeyDownHandler(event, incModal.getID());
});
});
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'styles/incident_glide_modal.css';
document.head.appendChild(link);
}
function refreshRelatedIncidents() {
GlideList2.get(g_form.getTableName() + '.' + g_list.getRelated()).setFilterAndRefresh('');
}
Here is the script include:
getURL: function() {
var sysId = this.getParameter(this.PARAMS.SYSID);
var pTable = this.getParameter(this.PARAMS.PARENTTABLE);
var url = "https://dev221704.service-now.com/x_564970_games_sam_grounds_list.do?sysparm_query=venue%3DNULL&sysparm_view=service_allocation";
return url;
},
I'm just hardcoding my url.
When I try to test, the ui page is showing up but I want to show both Add All and Add selected UI actions in the Pop up (SCreenshot -1).
Below is the screenshot: -> My trail
I want to have functionality like "Add All" and "Add Selected" in my ui page. How to do it?
Any inputs?