Ui action for problem form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 10:37 PM
We have a requirement that, we need to add one Ui action to the related list of outages in problem form.
When we clicked on that button, it should open a list view of outages.
Can any one help me with the script.
Any help will be appreciated.
Thank you,
Shiva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 11:09 PM
Hi,
So what did you start with and where are you stuck?
Did you check something similar is available on incident or problem and you can try to replicate that?
Regards
Ankur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2022 12:23 AM
Actually in those scripts, they called script includes i think.
So, i didn't understand what I need to change in those.
Basically i am not good at scripting. so, i didn't tried it. That's why i asked help in scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 10:15 PM
Hello
With your suggestion i tried by copying the script of Incident and i configured some what i know.
when i tried on clicking on that button, the outages list is opening as expected. But, when i tried to add an outage to the problem by selecting record in it, it is not adding outage record to it.
This is the script which i have configured :
function openIncidentList(){
var gajax = new GlideAjax("BulkAddChangeRequest");
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){
//render the modal
var incModal = new GlideModal('incident_add_records');
incModal.setTitle(getMessage("Add Incidents"));
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('');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2022 10:38 PM
Hi,
you will have to understand and the code and debug since you have picked it from some other table
Regards
Ankur