Kbase P21579: One way to do validation with a Smart Business Object (SBO)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/25/2003 |
|
Status: Unverified
GOAL:
What procedure can be use to validate a Smart Business Object (SBO)
GOAL:
How to get the handle of rowObject for a given SDO inside an SBO
GOAL:
How to pass the rowObject's handle to an external procedure to do validation
FACT(s) (Environment):
Progress 9.1x
FIX:
There is a preTransactionValidate procedure for the SBO itself (apart from that available for each SDO) which can be used to do validation. If an external procedure is needed to do the validation, the handle of the rowObject table for any SDO can be passed to it.
Example:
/* PreTransactionValidate in SBO */
DEFINE VARIABLE hSDO AS HANDLE NO-UNDO.
ASSIGN hSDO=DYNAMIC-FUNCTION('getRowObject':U IN h_dcust1).
RUN externalProc.p (hSDO).
END PROCEDURE.
h_dcust1 is the handle to one of the SDOs inside the SBO.
/* externalProc.p */
/* this receives hSDO */
DEFINE INPUT PARAMETER rObj AS HANDLE NO-UNDO.
DEFINE VARIABLE hField AS HANDLE NO-UNDO.
hField = rObj:BUFFER-FIELD("NAME").
MESSAGE "rowObject name in External procedure: " + rObj:NAME VIEW-AS ALERT-BOX.
MESSAGE "rowObject field: " + hField:NAME VIEW-AS ALERT-BOX.
MESSAGE "rowObject field value: " + hField:BUFFER-VALUE VIEW-AS ALERT-BOX.
The above will work provided the code is running from within the same Progress session.