- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:07 AM
Hello,
Currently under the Impacted CI's in change record, while trying to relate or add the CI, the 'Retired' CI's are also selectable. How to make it not selectable?
Operation Status = Retired
I believe we may need to make the changes in the "Add" UI Action?
Condition in the UI Action is
current.canCreate() && RP.isManyToMany() && parent.active == true && gs.getProperty('com.snc.task.associate_ci').indexOf(parent.getTableName()) > -1
And the script is :
function openCmdbCIServiceList(){
var gajax = new GlideAjax("AssociateCIToTask");
gajax.addParam("sysparm_name","getURL");
gajax.addParam("sysparm_id", g_form.getUniqueValue());
gajax.addParam("sysparm_add_to", "task_cmdb_ci_service");
gajax.getXMLAnswer(openServicesList);
}
function openServicesList(url) {
var cmdbciModal = new GlideModal('task_add_affected_cis');
cmdbciModal.setTitle(getMessage("Add Impacted Services/CIs"));
cmdbciModal.setWidth(1200);
cmdbciModal.setAutoFullHeight(true);
cmdbciModal.on('beforeclose', function(){
refreshImpactedServices();
});
ScriptLoader.getScripts('/scripts/incident/glide_modal_accessibility.js', function() {
cmdbciModal.template = glideModalTemplate;
cmdbciModal.renderIframe(url, function(event) {
glideModalKeyDownHandler(event, cmdbciModal.getID());
});
});
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'styles/incident_glide_modal.css';
document.head.appendChild(link);
}
function refreshImpactedServices(){
GlideList2.get(g_form.getTableName() + '.' + g_list.getRelated()).setFilterAndRefresh('');
var modal = window.GlideModal.prototype.get('task_add_affected_cis');
if (modal && modal.message)
g_form.addInfoMessage(modal.message);
}
function resizeIframe(){
var x = g_glideBoxes.cm_add_affected_cis;
x.autoDimension();
x.autoPosition();
x._createIframeShim();
}
Solved! Go to Solution.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:26 AM
Hi,
this article has the details
Apply Filter to ADD Button on Impacted Services/CI RelatedList
I shared solution here as well
Change the condition for Affected CIs and Impacted Services/CIs Related Lists
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:26 AM
Hi,
this article has the details
Apply Filter to ADD Button on Impacted Services/CI RelatedList
I shared solution here as well
Change the condition for Affected CIs and Impacted Services/CIs Related Lists
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2022 07:54 AM
Thank you so much Ankur. It worked. 🙂