The field can associate a status with the document, for example open, closed, and so on.
It also lets you set rules for changing numeric values in other tables, such as stock unloading and loading, commitments, and so on.
It can also run quantity checks before saving. For example, if a commitment has to be managed on the bill of materials of a stock item, the status simulates how many items will be needed. If there aren’t enough, it reports the missing quantity and blocks saving. Clicking Set Data lets you manage the various statuses. Statuses can also be created without managing any changes to quantity values.
The Document status field creates an additional field in the database to store the data of the selection made. For example, creating the field Stato automatically creates the field dat_stato. This field is only visible if the database is opened with other programs. Saving the data of the selected status is important, because many changes are made to several tables at the same time.
For example, when stock movements are managed, the program must know which operations were performed for each document. If I open an invoice and change the quantity of an item before saving, and this type of document affects stock, the program first restores the previous quantity and then deducts the updated one. This keeps item quantities aligned.
Field Parameters
Status name
The name of the status shown.
Color
The color of the status shown.
Default
If ticked, the program automatically selects this status when a new record is created.
Movements
The movements the program must make when a given status is set.
> Source additional table
The table from which the movement takes its starting values.
> Reference GGUID field in the additional table
The unique reference field of the source additional table.
> Movement QTY field in the additional table
The field of the source additional table that sets the quantity to change.
> Destination table
The table in which the quantity will be changed.
> Movement QTY field in the destination table
The field of the destination table whose quantity will be changed.
> Movement
The type of movement. None: no movement.
>> Down: the quantity is decreased.
>> Up: the quantity is increased.
> SQL condition
You can add an SQL string to filter the data further.
> Check that the value isn't below zero or above the qty
Checks that the quantity to move isn't below zero or above the quantity of the destination field. Shows a message if the condition occurs.
> Message for below zero
If you choose to check this, you can set a message to show when the condition occurs.
> Message for above available qty
If you choose to check this, you can set a message to show when the condition occurs.
> Bill of materials movement
The type of movement applied to the levels of the bill of materials. None: no movement.
>> First level Up: the first level is increased.
>> All levels Up: all levels are increased.
>> First level Down: the first level is decreased.
>> All levels Down: all levels are decreased.
> Bill of materials table
The table on which the bill of materials movements are made.
> Reference GGUID field in the bill of materials table
The unique reference field of the table on which the bill of materials movements are made.
> Bill of materials multiplication QTY field
The field of the table on which the bill of materials movements are made.
> Qty check field in the destination table
The field of the destination table on which the check is made.
> SQL condition
You can add an SQL string to filter the data further.
> Check that the value isn't below zero or above the qty
Checks that the quantity to move isn't below zero or above the quantity of the destination field, and shows a message if the condition occurs.
> Message for below zero
If you choose to check this, you can set a message to show when the condition occurs.
> Message for above available qty
If you choose to check this, you can set a message to show when the condition occurs.
> Pre-save checks
The checks the program must run before allowing the document to be saved when the status is set.
You can choose not to run any checks by leaving the fields empty.
> Source additional table
The source additional table to check before saving the document.
> Numeric field to check in the additional table
The numeric field of the source additional table that the program must check before saving the document.
> Rule
The rule used to check the field. None: no rule.
>> Equal: the field value must equal the given value.
>> Different: the field value must differ from the given value.
>> Less than: the field value must be less than the given value.
>> Less than or equal: the field value must be less than or equal to the given value.
>> Greater than: the field value must be greater than the given value.
>> Greater than or equal: the field value must be greater than or equal to the given value.
>> Between: the field value must fall within the range of the given values.
>> Not between: the field value must not fall within the range of the given values.
> Value 1
The first reference value.
> Value 2
The second reference value.
> Message
The message the program shows when the condition occurs.
> Saving
The action to take when the condition occurs.
>> Saving blocked: blocks saving the document when the condition occurs.
>> Confirm: when the condition occurs, asks the user whether to go ahead with saving or not.
