I’ve built an Android app, and I have a database on backendless. Now I want to add a new entry from my Android app directly to that same database. This is how my code looks like:
override suspend fun submitColorPalette(colorPalette: ColorPalette): ColorPalette {
return suspendCoroutine { continuation ->
backendless.of(ColorPalette::class.java).save(
colorPalette,
object : AsyncCallback<ColorPalette> {
override fun handleResponse(response: ColorPalette) {
Log.d("BackendlessDataSource", response.colors)
continuation.resume(response)
}
override fun handleFault(fault: BackendlessFault?) {
Log.d("BackendlessDataSource", "${fault?.message}")
Log.d("BackendlessDataSource", "${fault?.extendedData}")
Log.d("BackendlessDataSource", "${fault?.code}")
Log.d("BackendlessDataSource", "${fault?.detail}")
continuation.resume(ColorPalette())
}
}
)
}
}
I’m using ‘save’ function, and I’m passing ColorPalette object to it, which contains only two fields actually: approved(Boolean), colors(String). I haven’t included any other fields from that ColorPalette database that I already have, because I guess that other values like objectId, ownerId are automatically populated? And other fields that I don’t pass directly can be empty?
Nevertheless, when I try to submit that object that contains those two values, I get this message as a response: “Entity with ID not found”. Error Code: 1000
Here’s my database schema btw.