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 nameThe name of the state that will be displayed.
ColorThe color of the state that will be displayed.
DefaultIf checked, the program will automatically select this state on the creation of a new detail.
MovementsThese are the movements that the program must make when a certain state is set.
 Additional source tableIt is the table from which the movement will recover the values from which to start.
 Reference GGUID field in the additional tableIt is the unique reference field of the additional source table.
 Movement QTY field in the additional tableIt is the field of the additional source table that decides the quantity to be modified.
 Destination tableIt is the table in which the quantity will be modified.
 Movement QTY field on the destination tableIt is the field of the destination table whose quantity will be modified.
 MovementDecides 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 conditionYou can add an SQL string to further filter the data.
 I check that the value is not less than zero or greater than the qtyIt 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 zeroIf you decide to control this variable you can set a message to be sent when this condition occurs.
 Message for greater than available qtyIf you decide to control this variable you can set a message to be sent when this condition occurs.
 Bill of materials movementDecides 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 tableIt is the table on which to carry out the movements of the bill of materials.
 Reference GGUID field in the bill of material tableIt 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 fieldIt 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 qtyIt is the control field of the destination table to be checked.
 SQL conditionYou can add an SQL string to further filter the data.
 I check that the value is not less than zero or greater than the qtyIt 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 zeroIf you decide to control this variable you can set a message to be sent when this condition occurs.
 Message for greater than available qtyIf you decide to control this variable you can set a message to be sent when this condition occurs.
Pre-save checksThese 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 tableIt is the additional source table that the program must check before saving the document.
 Numeric field to be checked in the additional tableIt is the numeric field of the additional source table that the program must check before saving the document.
 RuleIt 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 1The first reference value.
 Value 2The second reference value.
 MessageThe message that the program must give when the condition occurs.
 SavingThe 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.