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

Put a default value list value based on the current users

Hi!
I've search all over the community but did not find the answer.

Here's the context :

I have an Object named Employee, for who I know his Office and his name.
Each M-files users is automaticaly created from this list.

When a user creates a new object named Assignement using a specific class, this class has also a property named Office.
By default, I would like to put the Employee's office as the default value. But the value could be modified if it's not the correct one for the user.

Automatic value of the property definition does not allow the user to change the value while he is creating the object.

So I'm not sure how to do this?

Thanks for your help!
Parents

  • Is there a different way to accomplish this goal?

    If I understand you correctly, you don't need the Person object to achieve your goal. You don't even need a concatenated placeholder, either.
    With the configuration shown in your screenshots and what you want to achieve I would proceed in the following way:

    1.) in M-Files Admin, add the property called "M-Files user" to your "Member User" Class
    2.) in M-Files desktop, populate this newly created property for all "Member User" objects manually (don't know if there is any automation procedure for that, I did it manually since we are a very small company). Alternatively - for testing purposes - populate only a few.
    You now have created a connection between two technically entirely different levels - an Object in M-Files and the corresponding M-Files user, simply by adding the M-Files user as a property to your "Member User" Object.
    3.) in M-Files Admin/ Metadata Card Configuration, you now have to create a Custom Placeholder called, for example, CurrentUserMemberUserObject. (go about just as you did before, but your reference should not be the Person object, but the MemberUser object). Configuration should then be:
    Name = CurrentUserMemberUserObject
    Object = Member User
    Property = M-Files User
    Mode = Static Value
    Static Value = (Current User)
    4.) Still in Metadata Card Config, populate the property "Member User" within "Test Class" with a dynamic value. The placeholder to choose is the one created in step 3. No concatenation nor anything else needed. Just the placeholder.

    This should do the job. Now if you create a new object belonging to Test Class, the "Member User" property should default to the current user. If I got you correctly, this in turn will automatically fill your "Member" property, which, in turn, will set the right permissions.
    Feel free to ask if anything remains unclear.
Reply

  • Is there a different way to accomplish this goal?

    If I understand you correctly, you don't need the Person object to achieve your goal. You don't even need a concatenated placeholder, either.
    With the configuration shown in your screenshots and what you want to achieve I would proceed in the following way:

    1.) in M-Files Admin, add the property called "M-Files user" to your "Member User" Class
    2.) in M-Files desktop, populate this newly created property for all "Member User" objects manually (don't know if there is any automation procedure for that, I did it manually since we are a very small company). Alternatively - for testing purposes - populate only a few.
    You now have created a connection between two technically entirely different levels - an Object in M-Files and the corresponding M-Files user, simply by adding the M-Files user as a property to your "Member User" Object.
    3.) in M-Files Admin/ Metadata Card Configuration, you now have to create a Custom Placeholder called, for example, CurrentUserMemberUserObject. (go about just as you did before, but your reference should not be the Person object, but the MemberUser object). Configuration should then be:
    Name = CurrentUserMemberUserObject
    Object = Member User
    Property = M-Files User
    Mode = Static Value
    Static Value = (Current User)
    4.) Still in Metadata Card Config, populate the property "Member User" within "Test Class" with a dynamic value. The placeholder to choose is the one created in step 3. No concatenation nor anything else needed. Just the placeholder.

    This should do the job. Now if you create a new object belonging to Test Class, the "Member User" property should default to the current user. If I got you correctly, this in turn will automatically fill your "Member" property, which, in turn, will set the right permissions.
    Feel free to ask if anything remains unclear.
Children
No Data