Linking Related data using client API
I have the following scenario which need your help please
Using the console we can update link to related items in other tables ,, but as far I as know the same thing can’t be done using the client API..
Take this scenario for example :
If I have two tables “peopleNames” and “peopleContacts” and I have “Contact” Field to store 1-1 reference to “peopleContacts” in “peopleNames” Table …. now today If I need to link an item from “PeopleContacts” then first I have to query “PeopleContacts” for the object and then update the Contact” Field in “peopleNames” with it ..this is fine but what if I already have the objectId of the record in “peopleContacts” can I just link it without updating or saving in “peopleContacts” ?
I couldn't see anyway where I just link that “Contact” object without Querying “peopleContacts” records for that ObjectId and without the need to save or update the record in “peopleContacts” table ..
Now if there is no way but to run that query first I have two issues with that :
1- It’s additional delay as I have to query for the whole Record before being able to update the “peopleNames” record when all I need is just to link that Object by objectId
2-There could be some updates on that same peopleContacts” record after I queried the table but before I actually update the “peopleNames” with the Related Contact Object .. This means with my save or update API call it will actually update all those fields for the Contact record in the “peopleContacts” table .. which mean overwriting some recent changes here also .
Because of the above issues, I thought there could be a way to just link a related object if we know the ObjectId …something similar to what we do in console today
am I missing anything here ?
Note: Im using iOS