Creating relations in parse.com with multiple classes (JavaScript SDK) <p>Using parse.com and JavaScript SDK.</p> <p>I've read alot about this, but cannot find any examples that fit my issue I'm trying to solve.</p> <p>Here is what I'm attempting to achieve.</p> <p>I want class "FriendRequest" to have a one to many relation with "myBadges". The child objects held in "myBadges" will be increasing overtime.</p> <p>The child objects are generated by a function that runs when the user selects a badge and uses "Yes, do it now!" to store it in "myBadges".</p> <p>At the moment I can only seem to create a relationship within the active class that the function uses. This means I have a relation set up in "myBadges" that just points to the User class, not to the class "FriendRequest".</p> <p>The relation is in this part of code</p> <pre><code> success: function(results) { // The object was saved successfully. userbadges.relation('BadgeConnect').add(userbadges); userbadges.save(); </code></pre> <p>So the problem I'm trying to solve is to move the relation link from the "myBadges" class to the "FriendRequest" class???</p> <p>An example answer how how to achieve this would be great to help me learn the correct approach.</p> <p>FULL CODE.</p> <pre><code>&lt;script type="text/javascript"&gt; Parse.initialize("xxxx", "xxxxx"); var MyBadges = Parse.Object.extend("myBadges"); var friendRequest = Parse.Object.extend("FriendRequest"); var userbadges = new MyBadges(); var friendRequest = new friendRequest(); var user = Parse.User.current(); $(document).ready(function() { $("#send").click(function() { var badgeselected = $('#badgeselect .go').attr("src"); userbadges.set("BadgeName", badgeselected); userbadges.set("uploadedBy", user); //userbadges.set('BadgeName'); //userbadges.save(); userbadges.save(null, { success: function(results) { // The object was saved successfully. userbadges.relation('BadgeConnect').add(userbadges); userbadges.save(); //location.reload(); }, error: function(contact, error) { // The save failed. // error is a Parse.Error with an error code and description. alert("Error: " + error.code + " " + error.message); } }); }); }); </code></pre>