Error while saving backendless entity with relationship schema.

I’m receiving the following error when saving a Backendless Entity.

FAULT = ‘8001’ [Duplicate property: Name] <Duplicate property: Name>

I have a table “UserFavorites” which consist of a relationship column “DummyClass”. I’m trying to create a UserFavorites entry with existing DummyClass entry. When i save the record, i get the following error.

let backendless:Backendless = Backendless.sharedInstance()
 let dummyClass:DummyClass!
 
 dummyClass = backendless.data.findById("DummyClass", sid: "5946A694-076D-13A8-FF87-443B6AD55C00") as! DummyClass
 print(dummyClass)
 
 let userFavorites:UserFavorites = UserFavorites()
 let dataStore = backendless.data.of(UserFavorites.ofClass())
 dataStore.save(
 userFavorites,
 response: { (result: AnyObject!) -> Void in
 let obj = result as! UserFavorites
 },
 error: { (fault: Fault!) -> Void in
 print("fServer reported an error: \(fault)")
 })

Hi Arasan,

Could you provide your UserFavorites and DummyClass classes here?

Regards,
Slava

You wrote: “I have a table “UserFavorites” which consist of a relationship column “DummyClass”. I’m trying to create a UserFavorites entry with existing DummyClass entry.”

But I don’t see it from your code: how do DummyClass object become the UserFavorites property?

Hi Slava -

Thanks for looking into this issue quickly. I have created a project to replicate the issue and uploaded the same in Google Drive. You can download the project via https://drive.google.com/file/d/0BwIr3n26ho2jTE0yVHZsUHc1Sms/view?usp=sharing.

Please see the attached screenshots for details.

Thanks,
Arasan

Slava - let me know if you need any further information…

Hi Arasan,

we are working with this issue now, and let you know about a solution.

Arasan, please see on your EventInfo screenshot: your EventInfo class has “Name” column. In the same time, your EventInfo class has “name” property, and server evaluates this as <Duplicate property: Name>.

You should rename your table column to “name”. Another way to fix this problem is to rename “name” property of EventInfo class to “Name”:



public class EventInfo : BackendlessEntity {
    var ownerId:String?
    var Name:String?
}

Regards,
Slava

Thank you Slava. Issue is now fixed.