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.
Method | Description | Possible customization |
---|---|---|
ValidateAsync | Validate 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. |
SaveAsync | Saves 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. |
IsCompletedAsync | Determines 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. |
CloneAsync | Clone form data from an existing item to a new one. | Overwritable to implement custom cloning logic, such as to manage related data or relationships. |
GetProvidedValues | Extracts 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. |
GetSectionNotificationCountAsync | Returns 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. |
GetActionsAsync | Retrieves 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. |
ProcessActionAsync | Handles 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. |