select list banner button checkbox on the UI action
function addRelationship() {
var sysId = g_form.getUniqueValue();
var modalForm = new GlideModalForm('New Relationship', 'task_rel_task');
modalForm.setOnloadCallback(function(dialog) {
var form = window.frames.dialog_frame.g_form;
var sTable = sanitizeText(g_form.getTableName());
form.setLabelOf('parent', sTable); // make generic for table name
form.setLabelOf('child', 'Change Request');
form.setValue('parent', sysId);
form.setValue('type', 'd79870f60a25810200e92b77e3a41433', 'Caused by::Causes');
document.activeElement.blur();
});
modalForm.setCompletionCallback(function(dialog) {
window.location.reload(true);
});
modalForm.render();
function sanitizeText(sText) {
sText = sText.replace('_', ' ');
sText = sText.charAt(0).toUpperCase() + sText.substring(1);
return sText;
}
}
Comments
Post a Comment