Skip to content

Request_Validate - BaseData_Set

Request_Validate sends validation messages to all DDO Field's that will participate in the upcoming save

Type: Function
Return Data Type: Boolean

Syntax

Function Request_Validate Returns Boolean

Call Example

Get Request_Validate to BooleanVariable

Description

Request_Validate returns 0 (zero) if all items are valid, else returns a non-zero value.

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 (Request_Validate returns 0), 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.

Before a Request_Save is sent to a DDO, the Request_Validate message should be sent to validate that all data is valid for a save. When performing saves with a DEO or using a Web Browser object's high level save, this message is sent for you. If you are performing saves manually within a Batch Process or Web Object, you will need to send this message yourself.

Request_Validate sends validation messages to all DDO Field's that will participate in the upcoming save. If the validation of any field fails, an error is reported and the save will not proceed.

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_Validate 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.

It is important that you understand when and how this process occurs. Before a save, every single field in every single DDO that will participate in the save will be validated.This is a pre-save validation. Your database is not locked at this point.If any validation function returns a non-zero value, the Request_Validate will fail and return a non-zero value.An error message will usually be generated when a field validation fails.If DEOs are attached to the DDO, the DDO will attempt to give the focus to the DEO that contains the invalid field data.This field validation is a different process than the actual DDO save validation (Validate_Save), which occurs much later in the save process.

See Also

Save Operations in DDOs

Return Value

Returns 0 (zero) if all items are valid, else returns a non-zero value.