My scenario is as follows:
- User table has a field “Related_Company”, which is an object relation field to Company table
- Course table has a field “Related_Company”, which is an object relation field to Company table
I want to list all courses related to the Company that the User is also related to.
In the REST console I can do this by using the objectId of the Company, but in UI Builder it does not seem that related fields are visible/part of the current logged in user object.
So, how can I get a list of related objects? Do I have to split this in two DB queries, and retrieve first the company Id related to the user, then use the same Id to get the Courses that I want?
Or is there a simpler way?