App Formula for column Quantity work incorrecly

Dear

I'm facing a issue with App Formula work not stable. please help

Here is my formula

duytv254_0-1702897319074.png

in happy case:

Step 1: input in SalesOrderDetail quantity: 7

Step 2: in SalesOrder screen, data will be loaded automatic by formula above: quantity 7

Step 3: update SalesOrderDetail quantity: 5

Step 4: back to SalesOrder screen, data will be loaded automatic by formula above: quantity 5

work_correctly(2).gif

in unhappy case:

Step 1: input in SalesOrderDetail quantity: 7

Step 2: in SalesOrder screen, data will be loaded automatic by formula above: quantity 7

Step 3: update SalesOrderDetail quantity: 5

Step 4: back to SalesOrder screen, data not loaded automatic by formula above: quantity 7

work_failed(2).gif

Solved Solved
0 3 229
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

Hi @duytv254 

Are you using a virtual or real column [Quantity] for your calculation?

From my point of view, you are facing a common situation with real columns.

For understanding:

- real columns get calculated on edition only

- virtual columns get calculated on the fly, "always"

For reference:

Use virtual columns - AppSheet Help

Can you share a screenshot of your app editor before clicking on the detail of the calculation? Is the pencil icon attached to your column blue or black?

 

View solution in original post

3 REPLIES 3

Aurelien
Google Developer Expert
Google Developer Expert

Hi @duytv254 

Are you using a virtual or real column [Quantity] for your calculation?

From my point of view, you are facing a common situation with real columns.

For understanding:

- real columns get calculated on edition only

- virtual columns get calculated on the fly, "always"

For reference:

Use virtual columns - AppSheet Help

Can you share a screenshot of your app editor before clicking on the detail of the calculation? Is the pencil icon attached to your column blue or black?

 

Thanks you so much, you pointed out the correct point

This is a Parent/Child type of relationship and HOW you select the SalesOrderDetail (child) row will make a difference on updating of the SalesOrder (parent) columns.   

For updates to be automatic with no additional implementation, you must access the SalesOrder row in EDIT mode first- i.e. select a SalesOrder row for editing - then choose the SalesOrderDetail row you wish to change from the Inline table in the Form View.  This will open the SalesOrderDetail row in EDIT mode as well BUT it will be within the context of the SalesOrder row.  When you Save, you are returned to the SalesOrder Edit view again where values will be updated AND you must tap Save again for these updates to persist.

IF you access a SalesOrderDetail row from the SalesOrder DETAIL view ...OR... from a SalesOrderDetails table view, these editing actions are NOT within the context of the parent SalesOrder row and will not automatically update that parent row.  You can achieve the updates by attaching an action on Form Save of the SalesOrderDetail Form view, which does "touch" the Parent SalesOrder row to perform the updates there as well.  You can perform any simple update and that is enough to trigger ALL the App Formulas on the row.

Top Labels in this Space