For an OpenEdge Data Object resource, the signature of the ABL routine that implements a Create operation must have a single INPUT-OUTPUT parameter for a DATASET, DATASET-HANDLE, TABLE or TABLE-HANDLE. If the resource supports before-image data, the parameter can only be for a DATASET or DATASET-HANDLE.
The following example shows a CreatedsCustomer( ) method that might implement the Data Object Create operation for the ProDataSet resource, dsCustomer:
METHOD PUBLIC VOID CreatedsCustomer(INPUT-OUTPUT DATASET dsCustomer):
DEFINE VAR hDataSet AS HANDLE NO-UNDO.
hDataSet = DATASET dsCustomer:HANDLE.
This implementation simply calls an overload of the CreateData( ) method defined in the OpenEdge.BusinessLogic.BusinessEntity super class, which OpenEdge provides as an aid for implementing Data Object resources that support before-imaging. The invoked CreateData( ) method provides a default implementation to create a new record in the server database from the single temp-table record in the ProDataSet input to CreatedsCustomer( ).