Skip to main content

UI Macro: link to CIs assigned to user

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
 

Assets currently assigned to this user:
<a href='' onclick="event.preventDefault();gdprRef('${gs.getMessage('gdpr')}');">click here</a>

<script>
 
function gdprRef(url){
  var req_for=g_form.getValue('var_requested_for');
  if (req_for!=''){
var dialog = new GlideDialogWindow('show_list');
dialog.setTitle('Assets assigned to user');
dialog.setPreference('table', 'cmdb_ci_list');
dialog.setPreference('sysparm_view', 'default');
var query = 'assigned_to=' + req_for;
dialog.setPreference('sysparm_query', query);
    dialog.render();
  }
}

Comments

Popular posts from this blog

Get URL Parameter - server side script (portal or classic UI)

Classic UI : var sURL_editparam = gs . action . getGlideURI (). getMap (). get ( ' sysparm_aparameter ' ); if ( sURL_editparam == 'true' ) { gs . addInfoMessage ( 'parameter passed ); } Portal : var sURL_editparam = $sp . getParameter ( " sysparm_aparameter " ); if ( sURL_editparam == 'true' ) { gs . addInfoMessage ( 'parameter passed ); }

URL link in addInfoMessage

var ga=new GlideAjax('gld_HR_ajax'); ga.addParam('sysparm_name', 'checkEmployeeNumber_hrProfile'); ga.addParam('sysparm_hrprofilenumber', g_form.getValue('number')); ga.addParam('sysparm_employeenumber', newValue); ga.getXMLAnswer(function(answer) { if (answer!='undefined' && answer!=''){ var navURL="<a style='text-decoration:underline;color:blue' href=hr_profile.do?sysparm_query=number=" + answer + ">" + answer + "</a><img width='3' src='images/s.gif'/>"; var sMsg='The employee number entered already exists on another HR Profile ' + navURL; //alert(sMsg); g_form.showErrorBox('employee_number', 'error - please check'); g_form.addInfoMessage(sMsg); } });