I have a table that has a relationship with a Geopoint. I get the data from the server using the iOS API 3.0.37 and then I modify some data of the object in my code (Geopoint data remains untouched) and then I try to save the object back to the server. The error I get back is the following
could not save object FAULT = ‘1003’ [Cannot persist object. Property ‘objectId’ must be set by the server. Make sure the property is not initialized when saving new object.] <Cannot persist object. Property ‘objectId’ must be set by the server. Make sure the property is not initialized when saving new object.>
Note: If the update method is used instead of the save method, then the call succeeds. Is there something changed in 3.0.37 that I must use the update method when an object is retrieved from the server? So far I have been using only the save methods and it was working.
Thank you in advance.
Regards,
George
Hi, George, will look into this.
As far as I understand you can get the intended result by using “update” method? Or there’s something that does not allow you to do this?
Yes, the update method works. As a workaround for now I will check if the object id is not null and call the update method, else I will call save.
Hi George,
Please, provide here your class, which objects you save, and code you are using for retrieving and saving an object.
Also give us your appId, we will check this issue with your data.
Regards,
Slava
We cannot reproduce the issue with second ‘save’. This is our sample project in attachment, which demonstrates that.
You could try it with your appId and secretKey - how it works for you? And compare with your implementation.
TestGeoPointRelSave.zip (20.58MB)
Hi Slava,
Thank you for your response. I can not see the attachment, so I can download and try it
Regards,
George
I just re-tried it on my app, and seems to be working…I am not sure why it was not working yesterday, but today it seems to be working fine.
My apologies for the inconvenience.
Regards,
George
Sorry, George, I’ve fixed the attachment.