When trying to save an object to Backendless after updating it, an Illegal Argument Exception is thrown.
Throughout my app, I have a static object representing my backendless object, which I update with getter and setter every so often. Each time I change a value on the object, I want this to be saved to Backendless, so I use the Async version:
Backendless.Persistence.save(teamO, new AsyncCallback<KLTeam>() {
@Override
public void handleResponse(KLTeam savedTeam) {
Log.i("TeamObject: ", "Saved.");
activeTeamObject = savedTeam;}
@Override
public void handleFault(BackendlessFault fault) {
Log.e("TeamObjectSaveFailure:",fault.getCode());
}
});
However when I do this, I receive an Illegal Argument Exception. This method has worked before, wondering what I could be doing to make it not work?
In order to move forward with this issue, I am guessing that there is a discrepancy between my own object values and the ones on Backendless and that is why I am having a problem here. In terms of keeping a static object throughout my app lifetime which updates values as necessary, and saving the object to Backendless each time. Is there exist a way to merely update + save one value on Backendless for a given object?
Or should I keep the objectId saved locally, then do a BackendlessQuery for the object that matches the saved Id, and update that , then immediately resave it? I ask because that is the example given when it comes to “Updating Data Objects” as linked to here.
The example in “Updating Data Objects” shows that you can use “save” method for both create and update operations (depends on whether the saved object already contains objectId).
According to our Support Policy we can not debug/troubleshoot your code.
If you find a bug in Backendless service (or inconsistency with our documentation) and can provide stable steps to reproduce the issue, you are welcome to open another support topic.
Okay, thank you for responding