Hi
I need to change a number of field Names in a DataTable. Dozens, and it may chnage going fwd, hence the need for automation.
I have Table (FieldNameChgTable) with the fields to change. Can anybody PLEASE help with the M-Code to loop through the FieldNameChgTable to update the DataTable.
I can do it with VBA, but I'm trying toget more skilled in M-Code - but not sure how to do this.
Example
Pre Change
DataTable
Field1, Field2, Field3, Field4
x, x, x, x,
x, x, x, x,
Changes
FieldNameChgTable
From, To
Field1, NewName1
Field4, NewName4
Post Change
DataTable
NewName1, Field2, Field3, NewName4
x, x, x, x,
x, x, x, x,
Thx for your time
I need to change a number of field Names in a DataTable. Dozens, and it may chnage going fwd, hence the need for automation.
I have Table (FieldNameChgTable) with the fields to change. Can anybody PLEASE help with the M-Code to loop through the FieldNameChgTable to update the DataTable.
I can do it with VBA, but I'm trying toget more skilled in M-Code - but not sure how to do this.
Example
Pre Change
DataTable
Field1, Field2, Field3, Field4
x, x, x, x,
x, x, x, x,
Changes
FieldNameChgTable
From, To
Field1, NewName1
Field4, NewName4
Post Change
DataTable
NewName1, Field2, Field3, NewName4
x, x, x, x,
x, x, x, x,
Thx for your time