I am trying to implement a headline and ranking system in my application and have been unable to update the Rank of any of the entries (simple int + 1). I have tried using the generated methods as well as the code shown in the documentation but my objects never update.
Example code … (Headlines being the table)
Headlines h = Headlines.findById(headline.getObjectId());
h.setRank(h.getRank()+1);
h.save();
At the top of your post you say you’re getting BackendlessException, but then later you say “My code comes back successful”, so is there an exception or not? )) If there is, could you please check what specific line causes the exception? Is it the retrieval of a Headline object or saving it?
I have a like and a dislike method, one uses the functionality produced by the code generator (first 5 code bubbled), the other uses code that I have written based on examples in the documentation.
The generated code will produce an error and a crash. Exception details from logcat: BackendlessException{ code: ‘Internal client exception’, message: ‘null’ }
The crash happens in the save() method on the line:
The code based off of the examples will not crash but will return the message below and nothing gets updated (note: it seems to pick a different column everytime):
“Column with name post_Time already exists. Please, choose a unique name for the new column.”
The result of using this call is the duplicate column issue described above. Last run returned code 8001 and message: “Column with name title already exists. Please, choose a unique name for the new column”
We have reproduced this issue and we will fix this as soon as it possible. To work around this trouble rename your column names, they should start from lower case.
Hello Sergey, renaming the columns to start with all lowercase did not fix the issue, I am still getting duplicate ID messages. The Headlines.java class is attached (as a txt file).
Hello Sergey, the exact error I am getting is “Column with name post_Time already exists. Please, choose a unique name for the new column.” Though each run of the app sometimes the column name will change.