related inserts
Question


Good day, I want to detail my problem that I have, I work with related tables, and offline, my application is mobile, the problem is the following: when I register in the local main table that is called 'daily part', after the insertion I get its id, to then insert it in the dependent local table called 'works', it happens that locally the related inserts are done correctly, but when they are saved in the server tables, the following problem occurs: as before I saved the relation with the local id generated in the Local table 'labores', because in the permanent table 'labores', it is not saved with the id generated from the permanent table 'daily part' in my dependent table.



Yes, your local storage's Id for something might be different than when you decide to sync it to the server, because it's an autonumber. If you need a more permanent way to find your records give them a GUID perhaps? Not entirely sure I'm following the problem.

Hi! 

Your synchronization action has to change the "Labores" ParteDiarioId field according to the Id from ParteDiario new record. It has also to take in consideration if the ParteDiario record is a new one or not. 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.