Copy all approvers records of change when click Copy Change UI action

Hemagiri B
Tera Expert

Hi Team,

Need your help, when I click on "copy change" UI action then I needs to copy all the approvers records from the main change record. Please help me out how can I achieve this. Your help is much appreciated.

 

Regards,

Hemagiri. 

6 REPLIES 6

piyushsain
Tera Guru
Tera Guru

Hi This is not possible as Copy Change works on the UI side and not server, it copies all the field values. I f you still want to do it please try with gsftSubmit, and try to copy all the approves from current to new record

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

@piyushsain Thanks for your reply. If possible can you please help me how we can try with gsftSubmit. Currently we are copying all filed values via script include by calling the system properties as below.

 

===================================================

ajaxFunction_getChangeQueryParams: function() {
        //read attributes list
        var attributesList = this._getCsvPropertyValue(this.PROP_CHANGE_ATTRS,this.CHANGE_REQUEST_DEFAULT_ATTR_VALUE);
        var srcSysId = this.getParameter('sysparm_src_sysid');
        var gr = new GlideRecordSecure(this.CHANGE_REQUEST);
        if (gr.get(srcSysId)) {
            var currentURL = "[code]<a target='_blank' href=/"+ gr.getLink() + ">" + gr.getValue("number") + "</a>[/code]";
===================================================

Hi,

I have found a method for you. 

You need to create a field in Change request which can be hidden and read only , for example "u_copy_from".

 

The in Copy Change UI action add the highlighted line , to add the "u_copy_from" in the query.

queryParam = queryParam+'^u_copy_from='+srcSysId;

Now when you will click copy change the sys_id of the record will be saved in the field(u_copy_from).

 

Now create a after insert BR and attach the approvers by Glide Recording the approver table and using the "u_copy_from" sys_id.

 

piyushsain_0-1690472816299.png

Hope this helps you 🙂

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

@Hemagiri B please let me know if this solves your issue

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain