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

Dupe transform map

tpoeckes
Giga Guru

I want to dupe (make a copy) of a transform map.   I brought up the map that I wanted to copy.   I changed the Name and right click "Insert and stay" but it doesn't save any of my field maps.

Thanks.

1 ACCEPTED SOLUTION

Bharath40
Giga Guru

Create a Ui action with following script.



copy(current);


function copy(current) {


    current.name = "Copy of " + current.name;


    var gr = new GlideRecord('sys_transform_entry');


    gr.addQuery('map', current.sys_id);


    gr.query();


    var newMap = current.insert();


    while (gr.next()) {


        gr.map = newMap;


        gr.insert();


    }


}


Thanks,


Bharath


View solution in original post

3 REPLIES 3

Bharath40
Giga Guru

Create a Ui action with following script.



copy(current);


function copy(current) {


    current.name = "Copy of " + current.name;


    var gr = new GlideRecord('sys_transform_entry');


    gr.addQuery('map', current.sys_id);


    gr.query();


    var newMap = current.insert();


    while (gr.next()) {


        gr.map = newMap;


        gr.insert();


    }


}


Thanks,


Bharath


francescodotti
Mega Expert

Hi all,

the simplest way is clicking on the UI Action "Copy" on the transf map.

It copies the field maps too!

 

If useful, please click on Helpful or Vote.

Thanks

Francesco

Unfortunately, it didnt copy all the fields, only the main script