Create a User with related object using javascript

Hi.

I’m using Javascrpt API in order to insert a User and I need create a relation with other objects.

I see examples like this writen in Java:
http://support.backendless.com/knowledge-base/article/registeringupdating-a-user-with-related-data-objects

I need to do the same but with javascript. I try things like:

var user = new Backendless.User();
user.email = conductor.correo;
user.password = conductor.documento;
user[“business_rol”] = newRol;

But i get this error in the javascript developer console:

Missing ___class property for entity: rol

Please Help!!

Is there the “rol” property in the user object?

Yes sir.

By the way.

Hello. I still need help.

Hi Alejandro,

In case you haven’t defined a JS class for the related entity, you need to manually add a field “___class” with a name of the related table.
Also you can see the examples in the documentation: https://backendless.com/documentation/data/js/data_relations_save_update.htm