How to Force a Field Calculation / Field Concatentation

This forum is for application developers who are integrating HanDBase into their solutions via the HanDBase API (HAPI) or other means. It's also a great place to discuss runtime development.

How to Force a Field Calculation / Field Concatentation

Postby hudsonhawk » Thu Mar 26, 2020 9:07 am

I've an on-going issue which I've assumed is a bug(s) but want to try and hammer at long last: my field calculations do not always work! Note this is on iOS.

I've seen this in two instances - either when the field formula is very complex involving multiple fields or most consistently when using the "Concatenate" function.

The former will happen often under the following:
- when doing calculations with multiple dependent fields
- when doing calculations with child records

The latter (concatenation) will often result in the following:
- I have the feature turned on to do it with every field edit
- what will happen is that the concatenation will often miss a field or have an incorrect value.

The fix for both of these is to open the record, edit it, and save it. Or if it involves child records, opening every child record and doing the same and then going back to the master record.

Any tips or best practices are most appreciated. Thank you.
hudsonhawk
 
Posts: 18
Joined: Sun Nov 27, 2016 4:49 pm

Re: How to Force a Field Calculation / Field Concatentation

Postby aa6vhDave » Fri Mar 27, 2020 10:35 am

Interesting.

On my Android device, the calculations are done in physical column order. So if the calculation is dependent on a column declared after the calculated column, that dependency may not yet have been updated properly. Of course, running the calculation a second time would find the dependency already updated, and would now work. Something to verify on your database.
aa6vhDave
 
Posts: 61
Joined: Mon Aug 19, 2013 1:42 pm

Re: How to Force a Field Calculation / Field Concatentation

Postby hudsonhawk » Fri Nov 06, 2020 9:56 am

Thanks Dave. Sorry for delay in my response.

I will verify later but I'm pretty certain my calculations are in order as I took some pains to reorder the database specifically for this reason. I will add that in one case (I'm pretty sure I've seen it other places but less common) I'm using every field and there are a large number of calculated fields (over 20!).

What's weird is to correct this issue, I just open and close the record 2 or 3 times - it gets calculated correctly.
hudsonhawk
 
Posts: 18
Joined: Sun Nov 27, 2016 4:49 pm

Re: How to Force a Field Calculation / Field Concatentation

Postby aa6vhDave » Fri Nov 06, 2020 11:09 am

When I referred to physical order, I did mean the order the database fields (columns) where originally declared (as shown in the Database Properties, Fields). I do not know if the order of processing when doing calculations will change if you reorder the fields. I suspect that the original order will still apply.

I have recreated some of my databases from scratch just to insure that the field (column) order is appropriate for my calculations.
aa6vhDave
 
Posts: 61
Joined: Mon Aug 19, 2013 1:42 pm


Return to HanDBase - Developers

Who is online

Users browsing this forum: No registered users and 1 guest

cron