J
Johan Vergeer
Guest
I would like to create a dataset containing a couple of temp-tables that are filled by an xml file.
DEF TEMP-TABLE ttOrder NO-UNDO
FIELD iOrderNo AS INT
FIELD iOrderDate AS DATE
INDEX ix RECID. // This also won't work, but this is needed to use the `OF` statement when retrieving records.
DEF TEMP-TABLE ttOrderLine NO-UNDO
FIELD iParent AS RECID
FIELD iArticleNo AS INT
FIELD dPrice AS DECIMAL.
DEF DATASET dsOrder FOR ttOrder, ttOrderLine
DATA-RELATION Order_OrderLine FOR ttOrder, ttOrderLine
RELATION-FIELDS ttOrder.RECID, ttOrderLine.iParent. // This is what won't work, but what I would like to do.
Usually I would just create an iOrderNo field in ttOrderLine and match that in the datasets RELATION-FIELDS attribute. Since the data is loaded from an XML file, this will be tough.
The end goal is that instead of this:
FIND FIRST ttOrder.
FOR EACH ttOrderLine WHERE ttOrderLine.iParent = RECID(ttOrder):
// Do something
END.
I would like to do this:
FIND FIRST ttOrder.
FOR EACH ttOrderLine of ttOrder:
// Do something
END.
The error I get now when using the last method is Index field of table1 must be fields in table2.
Could someone tell me how I can get this done?
Continue reading...
DEF TEMP-TABLE ttOrder NO-UNDO
FIELD iOrderNo AS INT
FIELD iOrderDate AS DATE
INDEX ix RECID. // This also won't work, but this is needed to use the `OF` statement when retrieving records.
DEF TEMP-TABLE ttOrderLine NO-UNDO
FIELD iParent AS RECID
FIELD iArticleNo AS INT
FIELD dPrice AS DECIMAL.
DEF DATASET dsOrder FOR ttOrder, ttOrderLine
DATA-RELATION Order_OrderLine FOR ttOrder, ttOrderLine
RELATION-FIELDS ttOrder.RECID, ttOrderLine.iParent. // This is what won't work, but what I would like to do.
Usually I would just create an iOrderNo field in ttOrderLine and match that in the datasets RELATION-FIELDS attribute. Since the data is loaded from an XML file, this will be tough.
The end goal is that instead of this:
FIND FIRST ttOrder.
FOR EACH ttOrderLine WHERE ttOrderLine.iParent = RECID(ttOrder):
// Do something
END.
I would like to do this:
FIND FIRST ttOrder.
FOR EACH ttOrderLine of ttOrder:
// Do something
END.
The error I get now when using the last method is Index field of table1 must be fields in table2.
Could someone tell me how I can get this done?
Continue reading...