Request_Save - BaseData_Set

Saves all changes in DEOs attached to this object or to any DDO that is a server of this object directly or indirectly

Type: Procedure

Parameters: None

Syntax
Procedure Request_Save 

Call: Send Request_Save


Description

A DataDictionary object (DDO) save is normally a two-step process. First you send Request_Validate to the DDO to make sure that your data is ready for the save. If your data is valid, you then send Request_Save to the DDO to perform the save.

In some cases, you will use objects such as data-entry object (DEOs) to handle the entire save for you. In other cases, you will need to write custom code to perform the save. In all cases, the save process itself is the same.

If you are sending Request_Save in a normal view with visible DEOs (e.g. not a BusinessProcess Object), you may also want to consider sending Request_Save to a DEO with a Server property set. This will ensure that DEO-based augmentations and verifications occur and Request_Save is then sent on to the Server DDO to perform the save.

When the save operation is performed by a DDO, it saves records into its main table as well as the tables in its parent DDOs. This allows updates in total fields in related tables to be performed as each record in the main table is created or edited. This action can also cause the creation of new records in any of the tables. Any record buffer that was not pointing to an already-existing record will have a new record created.

Function SaveCustomer returns Boolean
    Boolean bErr

    Get Request_Validate of oCustomer_DD to bErr
    If Not bErr Begin
       Send Request_Save of oCustomer_DD
       Move (Err) to bErr
    End

    Function_Return bErr
End_Function


Request_Save will return the handled error 4527 - DFERR_CANT_REFIND_RECORD when records cannot be refound/reread. The intent is to notify the user that someone must have deleted this record since it was last found by the user and that this is not a bug, but normal multi-user behavior when one user deleted a record that another user has pulled up in a view, etc.

The Request_Save message is responsible for saving new or existing records. When Request_Save is sent to a DDO, it will:



Request_Save is not re-entrant. Once a major Data-Dictionary operation (save, find, delete, clear) has begun you cannot start another major operation. The reentrancy restriction applies within DDO structures and across DDO structures.

See Also

Saves - Request_Save | Save Operations in DDOs | NewRecord command