The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Find relationships of Contact object from User Account?

Hi all, similar to a previous query of mine,
https://community.m-files.com/forums-1552881334/f/best-practices/6622/how-to-find-properties-off-contact-object

I need to use workflow pre-condition script to check if the user creating an object belongs to a particular Company

However, when I do something like this:
Dim oInitiator : oInitiator = PropertyValues.SearchForProperty(25).TypedValue.GetValueAsLookup.Item  ' Property 25 = Created By user
Err.Raise MFScriptCancel, "oInitiator: " & oInitiator

It returns the User Account, rather than the actual Contact Object. And the User Accounts don't link to Companies, it's the object contacts which do that.
Contact Objects do link to their User Accounts with an 'M-Files User' property

So, is there a way to get the details and relationships of the Contact object from the User Account?
Many thanks