Hi Backendless team, I’m using BackendlessSwift 6.0.1.1. I noticed that in a recent update, some relation change listeners are added in the EventHandlerForClass file, such as addAddRelationListener and addSetRelationListener. I was just wondering do they work now? I tried using this API and seems not working on my side. Besides, the document didn’t seem to cover this update.
Backendless Version (3.x / 6.x, Online / Managed / Pro )
Hi @olhadanylova, thank you for your quick response. I tested your code, it worked.
However, I use a different way to add relation. I use transaction UnitOfWork to add the relation. In my case, the listener won’t be triggered. My code looks like
let uow = UnitOfWork()
let _ = uow.addToRelation(parentTableName: "Person", parentObjectId: "F39C5358-E5E1-46AF-AD6F-5CA4BC9CA21E", columnName: "address", childrenObjectIds: ["C17CF32D-02AD-43C4-8EB7-6CCB1A5E3BD1"])
uow.execute(responseHandler: { result in
print(result.isSuccess)
}, errorHandler: { fault in
print("Error: \(fault.message ?? "")")
})
In my project, the addRelation work should be done in a transaction with some other operations. Does your team plan to add this listener support for transactions in the future?