Create a User with related object using javascript


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:

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

var user = new Backendless.User(); = 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: