0

I am using Parse and JavaScript.

I know the ObjectId from the Status_id-class but is not able to update the column in Question_status-class because it is a Pointer-type

How should I update a Pointer column with JavaScript..

var Answer = Parse.Object.extend("Question_status");
    var answer = new Answer();
    answer.id = question_status_id;
    answer.set("answer", selectedAnswer);
    answer.set("status_id", "duMW5p8Dh3");

    answer.save(null, {
      success: function(answer) {
        //console.log('New object created with objectId: ' + answer.id);
        $.mobile.changePage( "#finish", { transition: "slideup", changeHash: false });
      },
      error: function(answer, error) {
        console.log('Failed to create new object, with error code: ' + error.description);
      }
    });

1 Answer 1

1

You can basically create a pointer, the same way you are with question_status:

var answer = new Parse.Object("Question_status");
answer.id = question_status_id;
answer.set("answer", selectedAnswer);

var status = new Parse.Object("Status_id");
status.id = "duMW5p8Dh3";
answer.set("status_id", status);

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

Comments

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.