Support > Repository > A formula > Prepare a calculation formula and editable items

Items for which formulas are set are read-only. By combining this with ordinary input items, we will explain how to prepare items that can be automatically calculated and edited.

"Billing amount" of the "estimate" model can be calculated by calculation formulas, but also editing items for input are prepared.(Figure 1)

Fig. 1 Automatic calculation and inputting of charged amount item

If there is a value in the entry field (ie, it was manually entered), that value takes precedence.If the input field is empty, use the calculated value as it is.(Figure 2)

Only one is shown in Fig. 2 display

The item of "charged amount"ThreeI will prepare.Each has the following features.

Item IDUsea formulaDB storageHide on display
total_calc Keep automatic calculated values ​​on registration update screen SUM(${precord/p_syoukei}) do not do
total_input Maintain input values ​​on registration update screen None do not do
total For detailed screen IF(${total_input}>0,${total_input},${total_calc}) To -
Figure 3 Definition of charged amount item

Total_calc item

Prepare for the purpose of keeping calculated values ​​automatically on the registration update screen.Values ​​are not stored in the database.(Fig. 4) When displayed, it is assumed to be a hidden item.(FIG. 5)

Figure 4 Definition of total_calc item (1)
Figure 5 Definition of total_calc item (2)

Total_input item

Prepare input items on the registration update screen.Values ​​are not stored in the database.(Fig. 6) Hidden items when displayed.(FIG. 7)

Figure 6 Definition of total_input item (1)
Figure 7 Definition of total_input item (2)

Total item

If there is an input in the total_input item, this is assumed to be positive.Otherwise, the value of the automatic calculation value (total_calc item) is held in the database.Use this item when searching.(FIG. 8, FIG. 9)

Fig. 8 total item (1)
Figure 9 total item (2)

There is also a method to prepare "Add button", calculate it by pressing it, and overwrite the value.In this case, rewrite the value directly for input possible items.

For details, please refer to "Input control> Treat different items as a group and copy values ​​collectively> Describe processing of original button".