Kbase P99506: How to get the handle of a parent SDO from a smartDataViewer with a child SDO data source.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  31/12/2004 |
|
Status: Unverified
GOAL:
How to get the handle of a parent SDO from a smartDataViewer with a child SDO data source.
GOAL:
The Parent and Child smartDataObjects are linked via a data link with foreign fields.
FIX:
Get the handle of the viewers datasource (the child SDO), and then the handle of the child SDO's datasource (the parent SDO). When you have the parent SDO handle you can run any procedure in it.
As an example here the updateRecord procedure has been overridden in the smartDataViewer to refresh the displayed values after an update:
RUN SUPER.
/* Code placed here will execute AFTER standard behavior. */
DEFINE VARIABLE h_OrderSDO AS HANDLE NO-UNDO.
DEFINE VARIABLE h_CustomerSDO AS HANDLE NO-UNDO.
DEFINE VARIABLE cType AS CHARACTER NO-UNDO.
DEFINE VARIABLE cName AS CHARACTER NO-UNDO.
{get dataSource h_OrderSDO}. /* get Order (child) SDO handle */
{get dataSource h_CustomerSDO h_OrderSDO}. /* get Customer (parent) SDO handle */
/* Check Order handle is correct */
cType = DYNAMIC-FUNCTION('getObjectType':U IN h_OrderSDO).
cName = DYNAMIC-FUNCTION('getObjectName':U IN h_OrderSDO).
MESSAGE cType Cname.
/* Check Customer handle is correct */
cType = DYNAMIC-FUNCTION('getObjectType':U IN h_CustomerSDO).
cName = DYNAMIC-FUNCTION('getObjectName':U IN h_CustomerSDO).
MESSAGE cType Cname.
RUN refreshRow IN h_CustomerSDO.