Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 03:04 AM - edited 10-31-2023 03:04 AM
Hi Team,
"u_solution" is a field in child table
"sn_ind_tmt_orm_order_line_item" is the child table is in scope 'abc'
"u_temp_solution" is a field on parent table
"sn_csm_om_order_line_item" is parent table for reference which is in scope 'xyz'
I have written below Fix script in scope 'xyz' to copy data from a field on child table to the field on parent table but its not getting copied.
var gr=new GlideRecord('sn_ind_tmt_orm_order_line_item');
gr.query();
while(gr.next()){
if(gr.u_solution!='' && gr.u_temp_solution==''){
gr.u_temp_solution=gr.u_solution;
gr.update();
}
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 04:26 AM
Hi @Community Alums
Let's try the below script.
var grChild = new GlideRecord('sn_ind_tmt_orm_order_line_item');
grChild.addNotNullQuery('u_solution');
grChild.query();
while(grChild.next()){
var grParent = new GlideRecord('sn_csm_om_order_line_item');
grParent.addQuery('sys_id', grChild.parent) //Replace the Parent field name from the child table.
grParent.query();
if(grParent.next()){
grParent.u_temp_solution = grChild.u_solution;
grParent.update();
}
}
Let me know if it works for you.
Cheers,
Tai Vu
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 04:26 AM
Hi @Community Alums
Let's try the below script.
var grChild = new GlideRecord('sn_ind_tmt_orm_order_line_item');
grChild.addNotNullQuery('u_solution');
grChild.query();
while(grChild.next()){
var grParent = new GlideRecord('sn_csm_om_order_line_item');
grParent.addQuery('sys_id', grChild.parent) //Replace the Parent field name from the child table.
grParent.query();
if(grParent.next()){
grParent.u_temp_solution = grChild.u_solution;
grParent.update();
}
}
Let me know if it works for you.
Cheers,
Tai Vu