In an order entry view, I have a dbForm showing order total which is updated in the order line DD class. I would expect that the value in the dbForm would automatically be updated it the item price on an order line was changed, but it wasn’t so in this complicated view. At some places, I had the statement

Code:
Send Refresh of oOrhTot_Sum 0
which updated the dbForm in most cases, but not in all as we discovered last week. It seems that I have found a solution on this problem, but I don’t understand why it didn't work before and if it is the best way of doing this.

The central part of the file structure is shown below with customer orders to the left side and supplier orders to the right. On each customer order line there is a record number pointing to a supplier order line, but no relationship. Instead, the supplier order line is found manually when needed, for instance in Procedure Save_main_file of the order line dd object. As data also is needed from supplier order head, I had a relate statement after the find.

Code:
Move  ORL.SUPPORL_RECNUM to SUPPORL.FixRecnum
Find eq SUPPORL by Index.6
If (Found) Begin
Relate SUPPORL
It seems that this code made that the dbForm didn’t update when an order line was changed. Order total was updated in the database but not in the view.

However, substituting Relate SUPPORL with statements for just finding SUPPORH made the automatic update of oOrhTot_Sum work. Why can it be so? Relate SUPPORL does not change the record in the ORH file buffer. I am using DF 18.2


CUSTOMER...SUPPLIER
...../.................. /
ORH......ITEM....SUPORH
..../...../...... \......./
...ORL...........SUPORL