@Bob.Wang
Thanks for your code. Could you please give feedback on understanding the code of yours for following questions
I'm trying to understand In Table.query command what is Gt1.ROW_Number. What this does actually.
And if(res.numRows<=0) continue; What is this code for ?
res.cloneTo(Table("GlobalTable2")); why are you cloning to Global Table2?
Object agvnetwork = Model.find("AGVNetwork");
treenode an_cPs= agvnetwork.find(">?controlPoints");
treenode an_daT= agvnetwork.find(">?deallocationTypes");
Table gt1 = Table("GlobalTable1");
for(int i = 1; i <= an_cPs.subnodes.length; i++)
{
Object cpi_obj = ownerobject(tonode(an_cPs.subnodes.value));
Table res = Table.query("select *,Gt1.ROW_NUMBER as RN from $1 as Gt1 WHERE [Col 1] = $2 ", gt1, cpi_obj.name);
if(res.numRows <= 0)
continue;
res.cloneTo(Table("GlobalTable2"));
treenode maxAllocations = cpi_obj.find(">?maxAllocations");
treenode deallocationTypeRank = cpi_obj.find(">?deallocationTypeRank");
int gt1Row = res[1]["RN"];
cpi_obj.find(">?maxAllocations").value = gt1[gt1Row][2].as(string).toNum();
cpi_obj.find(">?deallocationTypeRank").value = an_daT.subnodes[gt1[gt1Row][3]].rank;
}