Is it possible to remove UI action for 'Add all' button on Configuration Item sys pop-up.

piyu
Kilo Contributor

Hello Everyone,

Where can I find the UI action corresponding to 'Add all' button on Configuration Item sys pop-up which was launched by clicking the 'Add' button on Affected CIs related list on a Change Request. It is basically to choose and add the CIs to a Change Request.

I come to know that there is a UI page "task_add_affected_cis.do" this page is used to create a GlideOverlay (the window that opens),and this UI page is getting call from the Script include "AssociateCIToTask".

I want to remove this "Add all" button from that popup view,can anyone please help me out with this?

Provided a screenshot of it below.

find_real_file.png

1 ACCEPTED SOLUTION

I found a way to achieve this using jQuery, after reading through the post mentioned above, Where can I find UI action for 'Add all' button on Configuration Item sys pop-up.



It involved modifying the "Add" UI Action. https://INSTANCE_NAME.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=77688cfe6f35f100e5f2b331...



Here's the code I used...



function openCmdbCIList(){


  var gajax = new GlideAjax("AssociateCIToTask");


  gajax.addParam("sysparm_name","getURL");


  gajax.addParam("sysparm_id", g_form.getUniqueValue());


  gajax.addParam("sysparm_add_to", "task_ci");



  gajax.getXMLAnswer(openList);


}




function openList(answer){


  var url = answer;



  var cmdbciOverlay = new GlideOverlay({


  id : "cm_add_affected_cis",


  title : getMessage("Add Affected Configuration Items"),


  iframe : url,


  closeOnEscape : true,


  showClose : true,


  onAfterClose: refreshAffectedCIs,


  onAfterLoad: resizeIframe, //Once PRB632264 is fixed by platform we can comment this line


  height : "90%",


  width : "90%"


  });





  cmdbciOverlay.center();


  cmdbciOverlay.render();



  cmdbciOverlay.setOnAfterLoad(replaceAddAllFunction); //Setting the On after load again replace the original one set previously


}




function refreshAffectedCIs() {


  var listId = g_form.getTableName() + ".task_ci.task";



  var list = typeof GlideList2 !== "undefined" ? GlideList2.getByName(listId) : null;


  if (list == null)


  list = typeof GlideList !== "undefined" ? GlideList.get(listId) : null;



  if (list != null)


  list.refresh();


}




function resizeIframe(){


  var x = g_glideBoxes.cm_add_affected_cis;


  x.autoDimension();


  x.autoPosition();


  x._createIframeShim();


}




function replaceAddAllFunction(){


  //Kepping what the resizeIframe was doing


  var x = g_glideBoxes.cm_add_affected_cis;


  x.autoDimension();


  x.autoPosition();


  x._createIframeShim();



  var iframe = document.getElementsByClassName("gb_iframe")[0]; //Get the iframe rendered



  var addAll = $j(iframe).contents().find("#add_all"); //Find the Add All button



  $j(addAll).remove(); //Remove the Add All button


}


View solution in original post

7 REPLIES 7

Hi Justin,

 

This has removed Addall but when I click on Add selected it doesnt closes the page. It stays there. I have to click close button to close it.

@Sowl - I am facing the same issue. Were you able to find a solution?

quiksilver
Mega Guru

Hi,

 

Where can I edit the filter for this pop up form? I wanted to put status not retired in the fileter for CI

 

Thanks

 

Quik