Order total does not update I have an order...

(Pim Sauter) #1

Order total does not update

I have an order app (similar to https://www.appsheet.com/samples/An-app-for-managing-customers-products-and-orders), where I calculate the order total in a similar way:

SUM ( SELECT (Order Details[Total], [Order Id] = [_THISROW].[Order Id]))

When I add new items to the order, the order total does not update; it only updates when I go into the order, go into edit mode and save it again. In the AppSheet example order app, this step is not necessary.

Any idea what goes wrong in my app?

(Aleksi Alkio) #2

Use virtual column instead of normal column.

(Pim Sauter) #3

@Aleksi_Alkio that works, thanks a lot!

Is there a specific reason it does not work with a normal column? Ideally, I want to save this order_total value to the database as well, which does not work with a virtual column.

(Praveen Seshadri (AppSheet)) #4

If the “child” has an IsAPartOf Ref column back to the “parent”, then we will also recompute all app formulas in the parent. When we do this, it means we also have to update and save the parent on sync. Otherwise, we will only recompute virtual columns.

(Pim Sauter) #5

@praveen I set IsAPartOf to true, but it does not update

(Multi Tech Visions) #6

@praveen has this ‘recomputing of the parent upon changes to the children if the IsAPartOf is set to true’ feature live?

Hope that made sense. :slight_smile:

(Praveen Seshadri (AppSheet)) #7

I could have sworn it was. Adding @Adam_Stone_AppSheet. Pim, could you try one thing. If you change an existing Details record, does it recompute the app formulas in the parent Order record? Maybe we only got that piece done but overlooked the case where a new Details record is added.

(Aleksi Alkio) #8

I tried to find a normal column structure like that from my apps but I realized that I’m always using a virtual column for complex reasons :slight_smile:

(Pim Sauter) #9

@praveen also changing an existing details record does not auto update the parent order record

(Adam Stone) #10

Within a nested form view, all the AppFormulas will update. For example, when adding a new order and then adding line items before saving the order. When adding or editing line items after the main order has been saved (i.e. from the detail view), currently only virtual column AppFormulas will update. We are working on making this more consistent such that all AppFormulas will update in both cases when the line item IsAPartOf the order.

(Pim Sauter) #11

Thanks for the update!