Abraham Zwygart
2010-08-03 15:24:03 UTC
I am in AX2009 using a form. There are four tables
InventTable, InventDim, InventSum and InventPieceSum
In the InventDim and InventSum I added a init method to these tables
Something like:
public void init()
{
;
super();
this.query().dataSourceTable(tablenum(InventSum)).addRange(fieldnum(InventSum, Closed)).value('0');
}
And this works Great.
On InventPieceSum I am linking back to InventSum and it needs to link by the
ItemId and InventDimId. It always links by itemId (even if I reverence a key
that has both fields), so I thought I could add something like this in it’s
init method:
this.query().dataSourceTable(tablenum(InventPieceSum)).addRange(fieldnum(InventPieceSum, InventDimId)).value(queryValue(InventSum.InventDimId));
I get the following query resualts:
SELECT * FROM InventTable
JOIN * FROM InventSum WHERE InventTable.ItemId = InventSum.ItemId AND
((Closed = 0))
JOIN * FROM InventDim WHERE InventSum.InventDimId = InventDim.inventDimId
AND ((NOT (InventLocationId = ' ')))
JOIN * FROM InventPieceSum WHERE InventSum.ItemId = InventPieceSum.ItemId
AND ((InventDimId = ' '))
The ‘(InventDimId = ' ')’ need to be ‘(InventPieceSum.InventDimId =
InventSum.InventDimId ')
How do I do this??
Thanks for helping
Abraham Z
InventTable, InventDim, InventSum and InventPieceSum
In the InventDim and InventSum I added a init method to these tables
Something like:
public void init()
{
;
super();
this.query().dataSourceTable(tablenum(InventSum)).addRange(fieldnum(InventSum, Closed)).value('0');
}
And this works Great.
On InventPieceSum I am linking back to InventSum and it needs to link by the
ItemId and InventDimId. It always links by itemId (even if I reverence a key
that has both fields), so I thought I could add something like this in it’s
init method:
this.query().dataSourceTable(tablenum(InventPieceSum)).addRange(fieldnum(InventPieceSum, InventDimId)).value(queryValue(InventSum.InventDimId));
I get the following query resualts:
SELECT * FROM InventTable
JOIN * FROM InventSum WHERE InventTable.ItemId = InventSum.ItemId AND
((Closed = 0))
JOIN * FROM InventDim WHERE InventSum.InventDimId = InventDim.inventDimId
AND ((NOT (InventLocationId = ' ')))
JOIN * FROM InventPieceSum WHERE InventSum.ItemId = InventPieceSum.ItemId
AND ((InventDimId = ' '))
The ‘(InventDimId = ' ')’ need to be ‘(InventPieceSum.InventDimId =
InventSum.InventDimId ')
How do I do this??
Thanks for helping
Abraham Z