If I go on Ouicool organization detail view, and I click on the related users data, I can see no users. Also, I can see two times users related data, whereas we should only see one entry for users related data on the left.
Thanks for your reply
I did not specify any relations on the agent code indeed.
I defined the one-to-many relationship twice so :
one for the Organization table
one for the User table
and I can now correctly list the organizations for a certain user on Forest.
But this was working before, without need of declaring anything in the agent code, and the relationships between the other tables are still working even if not defined in the agent.
Do I need to create all the relationships among my tables in Forest Agent code now ?
Is the following way of declaring the one-to-many relationship (a user can belong to only one organization, an organization has multiple users) correct ?
Base relationships are automatically created like before, you should not have to manually declare most of them.
One-to-many relationships are displayed as a field: organization should be a field of your user, leading to the organization record. So it’s not displayed in the related data list.
However, as organizations may have several users, you should see “Users” in the related data of any organization.
Your declarations of one-to-many relationships are not correct:
You should use addManyToOneRelation to create the user to organizations relationship:
Then, Forest Admin will use the relationship table to create the relationship. If not (that may be because the naming of your table or attributes is not standard), you can use the addManyToManyRelation customization to create it.
Don’t be afraid to ask chatGPT for help in first instance, for such things, it can help you a lot.