My users are related to a Company, and the relation company is present on the User object. The company is vital for many operations, so I would like to have it stored conveniently for use in the app I am making. However, using the built in functions for getting current user when logged in does not give back any related data. I also don’t want to use more API calls than necessary, so I was hoping to find a way to get the objectId of the company to be stored in the Users object using a generated column. Using a formula like “IF (LENGTH(company.objectId)>0, company.objectId, NULL)” seems to give rather random objectIds though, so I guess that is not the way to go.
How should I go about doing this? Do I need to do a separate call to store the company info in the User object on the client side and maintain it if not present? Or are there other smarter methods of handling this?
Also - Have a nice Christmas