I have a master detail relation and use autoinc fields for the keys. Everything works fine except when i call ApplyUpdates from the OnAfterPost event. The case is simple. I add a master, OnAfterPost is triggered, ApplyUpdates is called, then MergeDelta that causes an Edit…Post. And then the cycle repeats.
If i call ApplyUpdates outside the OnAfterPost event then it’s ok. The first time the delta contains all the modifications and the autoinc is -1; the second time the delta contains all the modifications with the generated value for the auto inc.
The problem raises when i insert a new master.
I use RadStudio 10.1 Berlin with RemObjects SDK 9.1.99.1273
why you can’t just insert data to both tables (master & detail) and then call master.ApplyUpdate?
another solution: try to use [ruoOnPost] in table.RemoteUpdatesOptions
I have tried runOnPost but the problem persists. Maybe i misuse it, i don’t understand the functionality of this attribute. My problem is MergeDelta causes an Edit…Post (probably for the AutoIncs generated value) that triggers my custom OnAfterPost event. I apply updates on the master only. And I try to guard against that with a test on HasDelta but the delta remains.
I already thought of that. Still, there might be something i do or use wrong. Should i apply updates on after post (i want to save everything on the spot)? What is the use of runOnPost? Thank you.