Base module

The Module class is the basic construct for creating DataWeb forms. All DataWeb sections have an associated class derived from Module. 

Typically, you use more specific classes for new modules such as ModuleForm and ModuleList , but it's useful to know how to customize them.

 

MethodDescriptionPossible customization
ValidateAsyncValidate the item and form data. Returns any validation errors as a list of ValidationErrors.Overwritable to add custom validation rules or to verify specific constraints of the data provided.
SaveAsyncSaves item and form data. Returns a ModuleSaveResult object with information about the fields that have changed.Overwritable to add custom logic while saving, such as database updates or notifications.
IsCompletedAsyncDetermines whether an item is completed for the current section. Returns a Boolean value.Overridable to add custom checks on the completion status of the item, such as field dependencies or advanced states.
CloneAsyncClone form data from an existing item to a new one.Overwritable to implement custom cloning logic, such as to manage related data or relationships.
GetProvidedValuesExtracts the values provided by the form data into a list of Form.ProvidedValue.Overridable to change the format or method of extracting the values provided, for example, to fit a specific template.
GetSectionNotificationCountAsyncReturns the number of notifications associated with the section as a long value.Overridable to calculate custom notifications, such as notifications based on specific states or events.
GetActionsAsyncRetrieves the list of available actions for the form. Returns a list of ContextActions.Overridable to define module-specific actions, such as exports, synchronizations, or other custom operations.
ProcessActionAsyncHandles the execution of a specific form action. Returns a result of type ContextAction.Result.Overwritable to implement custom logic for processing actions, such as advanced validations or actions on multiple entities.