Auto update from another DB

I previously posted regarding the mockup (below), but I have another question.

I’m testing a mockup in which I have two DBs, Target and Source, each with a key field, “id” (text). Source has another field, “sourceData” (Integer). Target a field, “targetField” (Integer).

What I’d like is to define targetField as a “calculated” field in which its value is the same as that in sourceData for the same id. (in reality the calculation will be something involving sourceData and several other fields inTarget, but this is just a test, so I’m keeping this simple.). sourceData may be updated by the user or even changed due to an import from a CSV file. So when these changes occur I want targetField to change.

I do have a procedure («Update Target») in Target that performs:
formulafill lookup(“Source”, id, id, sourceData)
for field “targetField” - it works.

I also tested having a “push” in Source using the “pull” operation above. This procedure has the one line:
farcall Target, “Update Target”
and that also works.

My question is: is there a way of defining targetField using the lookup so that I don’t have to include procedures? (In reality, I’ll be using DBs with many fields, and a number of them involve calculations similar to above, but calculations that involve many parameters, unlike the targetField example.)

I tried entering a formula in Field Properties of targetField, and also in the Code tab. These don’t work. So, does Panorama X have a way to attach a calculation to a field that automatically updates fields when data changes in the DB or in other DBs?

Only for the same DB, and only if you are manually entering data into a cell. If a procedure or an import changes the data, it’s not going to trigger an automatic calculation.

If all you want to do is display the result of the calculation, without necessarily storing it in the database, you can use a text display object in a form. Lookups from another database would still need to be explicitly triggered, but procedures or imports that change data in a field in the current database will automatically trigger the formula in the object, if that field is part of the formula.

Maybe I’m missing something, since Dave didn’t mention this, but have you looked at runfieldcalculations and runfieldsideefects?

I didn’t mention it, because he was asking about calculations that would run automatically when data changes, without the need for procedures.