Need to create a Info icon beside contact field

Srvs
Kilo Guru

Hi All,

i have a requirement that i need to create a "info icon" beside the 'contact' field,

at the time of clicking the icon it need to display total count of incidents, problems, changes for that person(who is available in contact field),

at the time of clicking it need to display like this...

find_real_file.png

please help me how to create,..

1 ACCEPTED SOLUTION

Hi Venkatesh,



Because the script, which I have provided, is not taking the query which is Active or not. Please find the modified UI Macro script below in bold. Request you to set your quesry as per your requirement and give it a try.



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" />


<j:set var="jvar_n" value="show_RITMs_${jvar_guid}:${ref}"/>


<g:reference_decoration id="${jvar_n}" field="${ref}"


  onclick="showRelatedRecordList('${ref}'); "


  title="${gs.getMessage('Show related Records')}" image="images/icons/tasks.gifx"/>



<script>


// show related list


function showRelatedRecordList(reference) {


  try {


  var displayValue = g_form.getDisplayBox(reference).value;


  var title = 'Showing records related to: ' +displayValue;


  var s = reference.split('.');


  var referenceField = s[s.length - 1];


  var query ='sys_class_name=incident^ORsys_class_name=problem^ORsys_class_name=change_request^active=true' + referenceField + '=' + g_form.getValue(reference);



  var gdw = new GlideModal('show_list');


  gdw.setTitle(title);


  gdw.setSize(750);


  gdw.setPreference('table', 'task_list');


  gdw.setPreference('sysparm_query', query);


  //gdw.setPreference('title', 'A New Title');


  gdw.render();


  } catch (e) {


  jslog('error showing related list');


  jslog(e);


  }


}



</script>


</j:jelly>




I hope this helps.Please mark correct/helpful based on impact


View solution in original post

19 REPLIES 19

I have a code that is for creating a reference icon only but beside the configuration item field,


I am not able to paste that code here.


Hi Venkatesh,



Beside any reference type field the OOB reference icon is already present. What do you want to achieve? Can you please provide the screenshot of the same? And also, did you able to achieve the retirement mentioned in the Subject?


when clicking the highlighted customized icon, it will display the number of incident and number change, number of problems as group wise, those are related to configuration item,


same like this I need to create a icon beside the contact field.


a1.PNG


Hi Venkatesh,



Please right click on the field 'Contact'-->Configure Dictionary-->Click 'New' from the 'Attributes' related list in the below-->Set the attribute as 'reference Contributions' with the value as the UI Macro name. Before these, needless to say, you need to create the UI Macro in your instance, which I hope is done already. Please find the screenshots below.


find_real_file.png


find_real_file.png



find_real_file.png




I hope this helps.Please mark correct/helpful based on impact


I am not getting the view you are showing, at the time of configure dictionary I got the view like below.


a2.PNG