Support Topics Documentation Slack YouTube Blog

Search objects for user table


(Carlos Alberto) #1

Hello, my user table has 1-n relationship with table B.

I need to fetch the objects from table B from the current user on the system.

I have tried in some ways without success, for example:
user = Backendless.UserService.CurrentUser ();
user.getProperty (“B”);
but returns type object, I need List B objects.

thanks


(Vladimir Upirov) #2

Hi Carlos
User’s relation is not loaded automatically when user login or register, even you have “autoload” enabled for the column, it’s not the same as for Data API, so that’s the reason why your current user has no relations
In order to have user along with relations, your can add event handler “afterUserLogin”, you can do it with Codeless



Of course instead of “Create list with” block you must add “Load relations” block