set reference attributes of an object using Javascript

0
Hi, I have a domain model as shown in below. We can set the attributes of student by using  obj.set('Name','hello') . But how to set its reference, Say how can i set/assign the college name to the student using javascript . Could some one please help me with this? Thanks in advance.
asked
1 answers
0

Do you need to use JavaScript? Using a Nanoflow would be a more Mendix way of doing this.

 

If you do need to do this using JavaScript then take a look at the addReference method of MxObject. That should let you set the association of a Student using the guid value of the College.

 

https://apidocs.rnd.mendix.com/10/client/mendix_lib_MxObject.html#addReference

 

I hope this helps.

answered