The CreatorCon Call for Content is officially open! Get started here.

Not all fields copy to a new change request

rjp
Tera Expert

Hi folks,

I recently inherited the Change Management module and was asked to add a couple new fields to the form.  I added them without issue but when i attempt to copy the change request, all fields copy except for the ones i added....

original Change Request

New Change Request....

 

I found a UI Action called copy_change_request, that i believe will copy all the fields to the new CR.  However I can't determine what in the code copies each of the form fields from the original to the new CR.  I'm hoping someone can help me decipher the code and help me add the two new fields so they get picked up in the new CR. here is the code...

 

function OnCopyChangeClick() {
function addParam(form, name, val) {
var inp = cel('textarea', form);
inp.name = name;
inp.value = val;
}

var srcSysId = g_form.getUniqueValue();

var ga = new GlideAjax('ChangeUtils');
ga.addParam('sysparm_name', 'getChangeQueryParams');
ga.addParam('sysparm_src_sysid', srcSysId);
ga.setWantSessionMessages(true);
ga.getXMLAnswer(function (queryParam) {
if (queryParam) {
var gotoUrl = [];
gotoUrl.push('srcSysID=' + srcSysId);
gotoUrl.push('newSysID=$sys_id');
gotoUrl.push('sysparm_returned_action=$action');

gotoUrl = 'CopyChangeRelatedLists.do?' + gotoUrl.join('&');

var form = cel('form', document.body);
hide(form);
form.method = "POST";
form.action = g_form.getTableName() + ".do";
if (typeof g_ck != 'undefined' && g_ck != "")
addParam(form, 'sysparm_ck', g_ck);
addParam(form, 'sys_id', '-1');
addParam(form, 'sysparm_query', queryParam);
addParam(form, 'sysparm_goto_url', gotoUrl);
form.submit();
}
});
}

 Thanks,

Robert

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

You need to look for sys_properties table. From Application navigator ( type sys_properties.list press enter) & then search for property 

com.snc.change_request.copy.attributes

 

In the value field of the property mention the attribute that you want to be copied over when Copy Change is used.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

View solution in original post

2 REPLIES 2

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

You need to look for sys_properties table. From Application navigator ( type sys_properties.list press enter) & then search for property 

com.snc.change_request.copy.attributes

 

In the value field of the property mention the attribute that you want to be copied over when Copy Change is used.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

rjp
Tera Expert

Thank you Jaspal, it worked perfectly!!