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

  • I am having a similar problem.

    I have a person object (created by the compliance Kit) and a value list of email addresses and a class with email address property.

    when a document is added using this class, i want the email address property to default to the current user's email address from the mfiles account (im guessing from the person object).

    how can i do this?

    Hi mturner,

    I think I might have a solution for you :)
    You can simply combine what has been suggested in reply #4 by Joonas and replies #5 & 7 by addyman. Here's a quick how-to, feel free to ask if anything remains unclear:
    1. set up a rule with a custom placeholder exactly like the one suggested in reply #4. what the custom placeholder does is that it checks for employee objects that have the current M-Files user as a value in their M-Files user property. Then the match is used as the output/ value of the custom placeholder. In other words, if you use the custom placeholder to calculate a dynamic property, the value will be an employee (namely the one that corresponds to the current M-Files user). But we don't want just the employee, but his/her email address. This is where step 2 kicks in:
    2. create an indirect reference as a dynamic value for the property you want (as shown in reply #7). The only difference should be that you do not use the Custom Placeholder "CurrentUserAccount" but "CurrentUserEmployeeObject". Make sure everything looks like in the screenshots attached - for me it did not work with the alias of the property, only with the ID, so go for References and then select the ID of the property rather than the alias!!

    You should now be good to go and the email of the employee that belongs to the current user should be fetched automatically when creating a new object.
    41378.zip
Reply

  • I am having a similar problem.

    I have a person object (created by the compliance Kit) and a value list of email addresses and a class with email address property.

    when a document is added using this class, i want the email address property to default to the current user's email address from the mfiles account (im guessing from the person object).

    how can i do this?

    Hi mturner,

    I think I might have a solution for you :)
    You can simply combine what has been suggested in reply #4 by Joonas and replies #5 & 7 by addyman. Here's a quick how-to, feel free to ask if anything remains unclear:
    1. set up a rule with a custom placeholder exactly like the one suggested in reply #4. what the custom placeholder does is that it checks for employee objects that have the current M-Files user as a value in their M-Files user property. Then the match is used as the output/ value of the custom placeholder. In other words, if you use the custom placeholder to calculate a dynamic property, the value will be an employee (namely the one that corresponds to the current M-Files user). But we don't want just the employee, but his/her email address. This is where step 2 kicks in:
    2. create an indirect reference as a dynamic value for the property you want (as shown in reply #7). The only difference should be that you do not use the Custom Placeholder "CurrentUserAccount" but "CurrentUserEmployeeObject". Make sure everything looks like in the screenshots attached - for me it did not work with the alias of the property, only with the ID, so go for References and then select the ID of the property rather than the alias!!

    You should now be good to go and the email of the employee that belongs to the current user should be fetched automatically when creating a new object.
    41378.zip
Children
No Data