To update the existing constructor and destructor:
Find the CONSTRUCTOR declaration in the file.
Add the code shown in bold:
CONSTRUCTOR PUBLIC customerForm ( ):
SUPER().
oServiceAdapter = NEW
openedge.tutorial.services.ServiceAdapter("CustMaint").
InitializeComponent ( ).
OpenQuery().
CATCH e AS Progress.Lang.Error:
UNDO, THROW e.
END CATCH.
END CONSTRUCTOR.
This step implements data access by creating a service adapter that uses a ProDataSet
(CustMaint) that is defined in
BECustMaint.cls.
Find the DESTRUCTOR declaration in the file.
Add the code shown in bold:
DESTRUCTOR PUBLIC customerForm ( ):
closeQuery().
IF VALID-OBJECT(components) THEN DO:
CAST(components, System.IDisposable):Dispose().
END.
END DESTRUCTOR.