Document state
This field can associate a state to the document. For example, open, closed, etc.
It also allows you to set the rules for managing any changes in numerical values on other tables, such as warehouse unloading and loading, managing commitments, etc.
It also allows you to manage any quantity checks before saving. For example, if it is necessary to manage a commitment on a bill of material of a warehouse item, the state simulates how many items will be needed. If there are not enough, it will report the missing quantity and prevent saving. By pressing on Set Data, we can manage the various states. They can also be created without having to manage any changes in quantity values.
The Document State field creates an additional field within the database in order to save the data of the selection made. So, for example, by creating the State field the program will automatically create the dat_state field. This field is visible only if the database is opened with other programs. It is important to save the selected state data as numerous changes are made to several tables simultaneously.
An example: when warehouse movements are managed, the program must know for each document which operations have been performed. If I open an invoice and upon saving, I change the quantity of an item, if this type of document acts on the warehouse, the program will first restore the previous quantity and then scale the updated one. This ensures alignment of the quantities of the articles.
Field parameters
State name
The name of the state that will be displayed.
Color
The color of the state that will be displayed.
Default
If checked, the program will automatically select this state on the creation of a new detail.
Movements
These are the movements that the program must make when a certain state is set.
Additional source table
It is the table from which the movement will recover the values from which to start.
Reference GGUID field in the additional table
It is the unique reference field of the additional source table.
Movement QTY field in the additional table
It is the field of the additional source table that decides the quantity to be modified.
Destination table
It is the table in which the quantity will be modified.
Movement QTY field on the destination table
It is the field of the destination table whose quantity will be modified.
Movement
Decides what kind of movement to make. None: no type of movement.
Downward: the amount will be scaled down.
Upward: the quantity will be increased.
SQL condition
You can add an SQL string to further filter the data.
I check that the value is not less than zero or greater than the qty
It will check that the value of the quantity to be moved is not less than zero or greater than the value of the quantity of the destination field. A message will appear if the condition occurs.
Message for less than zero
If you decide to control this variable you can set a message to be sent when this condition occurs.
Message for greater than available qty
If you decide to control this variable you can set a message to be sent when this condition occurs.
Bill of materials movement
Decides what type of movement to carry out at the levels of the bill of materials. None: no type of movement.
First level V. High: the first level will be increased.
All levels V. High: all levels will be increased.
First level V. Low: the first level will be scaled down.
All levels V. Low: all levels will be scaled down.
Bill of materials table
It is the table on which to carry out the movements of the bill of materials.
Reference GGUID field in the bill of material table
It is the unique reference field of the table on which to carry out the movements of the bill of materials.
Bill of Materials multiplication QTY field
It is the field of the table on which to carry out the movements of the bill of materials.
Control field on destination table of the qty
It is the control field of the destination table to be checked.
SQL condition
You can add an SQL string to further filter the data.
I check that the value is not less than zero or greater than the qty
It will check that the value of the quantity to be moved is not less than zero or greater than the value of the quantity of the destination field and will display a message if the condition occurs.
Message for less than zero
If you decide to control this variable you can set a message to be sent when this condition occurs.
Message for greater than available qty
If you decide to control this variable you can set a message to be sent when this condition occurs.
Pre-save checks
These are the checks that the program must carry out before allowing the document to be saved when this state is set.
You can decide not to perform checks by leaving the fields empty.
Additional source table
It is the additional source table that the program must check before saving the document.
Numeric field to be checked in the additional table
It is the numeric field of the additional source table that the program must check before saving the document.
Rule
It is the rule that the program must follow to control the field. None: no rules.
Equal: the value of the field must be equal to the given value.
Different: the value of the field must be different from the given value.
Less: the field value must be less than the given value.
Less or equal: the value of the field must be less or equal to the given value.
Greater: the field value must be greater than the given value.
Greater or equal: the value of the field must be greater than or equal to the given value.
Between: the field value must be in the range of data values.
Not between: the field value must not be in the range of data values.
Value 1
The first reference value.
Value 2
The second reference value.
Message
The message that the program must give when the condition occurs.
Saving
The type of action to take when the condition occurs.
Blocked saving: will block the saving of the document when the condition occurs.
Confirm: will confirm the save when the condition occurs.