Kbase P84211: ADM2: How to add, remove a link and set the foreign fields between two SDO objects at run time?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  26/08/2010 |
|
Status: Unverified
GOAL:
How to add, remove a link and set the foreign fields between two SDO objects at run time?
GOAL:
How to dynamically invoke the addLink and removeLink procedures and the setForeignFields DYNAMIC-FUNCTION?
FACT(s) (Environment):
OpenEdge 10.x
FIX:
The following code calls the addLink procedure and invokes the 'setForeignFields' dynamic-function to add a link between the parent (source) customer SDO and the child (target) SDO and set the CustNum field in each as the foreign field:
DYNAMIC-FUNCTION('setForeignFields':U IN h_dorder, INPUT "custnum,custnum").
RUN addLink(
INPUT h_dcustomer,
INPUT "data",
INPUT h_dorder
).
PUBLISH "dataAvailable" FROM h_dcustomer ("DIFFERENT").
The following code resets the foreign fields to blank, calls the removeLink procedure to remove the link established above between the Customer SDO and the Order SDO and reopens the query of the child (Order) SDO:
DYNAMIC-FUNCTION('setForeignFields':U IN h_dorder, INPUT "").
RUN removeLink(
INPUT h_dcustomer,
INPUT "data",
INPUT h_dorder
).
DYNAMIC-FUNCTION('openQuery':U IN h_dorder).