How to copy all the Fields/columns from one table to another(new Table) through Background scripts-urgent

Vijay27
Tera Guru

please help me

1 ACCEPTED SOLUTION

Hi,

Do you want to copy all records or some of them?

if you want all of them

then write code like 

var gr=new GlideRecord('Live feed message table name');

gr.query();

//gs.print(gr.getRowCount());

while(gr.next())
{
var cs=new GlideRecord('Target table name');
cs.initialize();
//as like bellow you can take values from gr and initialize them 
//make sure that field type shoulb be compatible
   // cs.u_item=gr.sys_id;
   // cs.u_stockroom='ffec3762dba71f004b6cf3561d9619c6';
   // cs.u_stock_number=100;
   // cs.u_stock_limit=10;
cs.insert();
}

 

 

Thanks

View solution in original post

5 REPLIES 5

Yes, or you can use Flow designer. Flow designer is easier to use, it´s graphical and you don´t need to create "code".

 

Please mark helpful or correct if I helped you.
This action will help other members with similar issues to find a solution.
Thanks
Ariel