0

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 :)

4
  • Could you check that client do have the permission to update the Class? Commented Dec 2, 2014 at 11:36
  • @eth3lbert But i can able to update other Class Values , IS there permission for particular Class can be blocked ? Commented Dec 2, 2014 at 11:43
  • 1
    Oops sorry, you should check both class level permission and object level(ACL) permission. Every class and object have there own permission. Commented Dec 2, 2014 at 11:46
  • I'll just commit an answer for it. Commented Dec 2, 2014 at 12:02

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0
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

2 Comments

Could you explain your answer a little?
please check. whether the given user id is allowed to write this object. parseplatform.github.io/Parse-SDK-JS/api/classes/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.