Consultor Eletrônico



Kbase 20020: ADM2 - How to Delete Records From a SmartDataObject (SDO)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/29/2008
Status: Verified

GOAL:

How to delete a record directly from a SmartDataObject (SDO).

FACT(s) (Environment):

Progress 9.x

SYMPTOM(s):

ADM2

FIX:

You can have just a SDO and a BUTTON for the trigger code. You can also have a SmartDataViewer to view the record you want to delete and a Navigation Panel to position to the record.

The sample code:

ON CHOOSE OF BUTTON-1
DO:
DEFINE VARIABLE vRowIdent      AS CHARACTER NO-UNDO.
DEFINE VARIABLE vLocalRowIdent AS CHARACTER NO-UNDO.

ASSIGN vRowIdent = DYNAMIC-FUNCTION('getRowident' IN h_dtables).

DYNAMIC-FUNCTION('fetchrowident' IN h_dtables, vRowIdent, "").

ASSIGN vLocalRowident = ENTRY(1,DYNAMIC-FUNCTION('colValues' IN  h_dtables,""), CHR(1)).

DYNAMIC-FUNCTION('DeleteRow' IN h_dtables, vLocalRowIdent).
END.

getRowident() returns the database ROWIDs.

DeleteRow() requires the RowObject ROWID as a string or as the first entry in a comma-separated string.

colValues() returns this comma separated string as the first CHR(1) entry.