Manohar singh
Manohar singh

Reputation: 509

{"code":101,"error":"object not found for update"} Parse.com Javascript SDK

I'm trying to update certain column value of my class matching the objectId of the class , Here is my code below

var GameScore = Parse.Object.extend("Address");
var query = new Parse.Query(GameScore);

query.equalTo("objectId", "xxxx");
query.first({
  success: function(object) {    
   alert(JSON.stringify(object));
    object.set("address","kkkkkk");
    object.save();
  },
  error: function(error) {
    alert("Error: " + error.code + " " + error.message);
  }
});

Now in the success function i get the row data for the given objectId, But the object.set and object.save alone not working , please advice what is gone wrong here.

I get "{"code":101,"error":"object not found for update"}" error in the reponse.

Thanks in advance :)

Upvotes: 0

Views: 2321

Answers (2)

alfonsoolavarria
alfonsoolavarria

Reputation: 1225

var acl = new Parse.ACL();
acl.setPublicWriteAccess(true);
acl.setPublicReadAccess(true);
acl.setWriteAccess(user.id, true);
model.setACL(acl);

Is a problem with ACLs. With this you can solve it

Upvotes: 0

eth3lbert
eth3lbert

Reputation: 813

Check both class level permission and object level(ACL) permission and make sure client have permission to update the object.

Also note that, All class and object have their own permission.

Upvotes: 2

Related Questions