Kbase P38016: How to access the value of a field in the SDO that is not in
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  20/08/2003 |
|
Status: Unverified
GOAL:
How to access an SDO field value from local displayfields of the viewer when the field is not in the viewer?
FACT(s) (Environment):
Windows
FACT(s) (Environment):
Progress 9.x
FIX:
The following code, inserted after the RUN SUPER of the local displayfields override in a smart data viewer demonstrates how to access the 'contact' field directly from the SDO regardless whether it is in the viewer or not by messaging its value. It is assumed that the 'contact' field is in the SDO.
/*** How to access an SDO field that is not in the viewer ***/
DEFINE VARIABLE hDataSource AS HANDLE NO-UNDO.
DEFINE VARIABLE hTableQuery AS HANDLE NO-UNDO.
DEFINE VARIABLE hRecordBuffer AS HANDLE NO-UNDO.
DEFINE VARIABLE hFieldBuffer AS HANDLE NO-UNDO.
DEFINE VARIABLE iCounter AS INTEGER NO-UNDO.
ASSIGN
hDataSource = DYNAMIC-FUNCTION('getDataSource':U)
hTableQuery = DYNAMIC-FUNCTION('getDataHandle':U IN hDataSource)
hRecordBuffer = hTableQuery:GET-BUFFER-HANDLE(1) NO-ERROR.
DO iCounter = 1 TO hRecordBuffer:NUM-FIELDS:
hFieldBuffer = hRecordBuffer:BUFFER-FIELD(iCounter).
IF hFieldBuffer:NAME = "Contact" THEN
MESSAGE hFieldBuffer:STRING-VALUE
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.