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

  • Metadata card configuration does not currently support indirect references

    Any news here (apart from what has been pointed out in the thread, that an indirect reference including CurrentUser is possible after "baking" a corresponding Custom Placeholder)?
    If I try an indirect reference in the metadata card configuration it doesn't work - see attached screenshot (this is the case although the concatenation fits the target data type of the property. I know this for sure because if I use another placeholder with incompatible data type, the error message is different).

    Thx 4 any help! :)

    EDIT: I tried this again with other properties, and it worked. I don't know what I did wrong in the past (maybe I did not use the ID of the respective properties, but their aliases, which still does not seem to work), but it looks like at least with certain props indirect referencing works (see reply #10, for instance)
    EDIT 2: Seems like indirection only works if the first level of the chain is a custom placeholder. If I use a normal/ default property I get the error msg "Property XYZ cannot be used as an indirection level". Correct me if I'm wrong, maybe there are other exceptions!
    I guess the reason for this is that the system lacks the information where to start the fetching. If it only knew that the first level is intended to be a property that is also on the metadata card of the object that is to be created! but it seems that it doesnt get this. With a custom placeholder however it is clear for the system what the starting point is. I guess it is even possible to add one or two more indirection levels if the first one is a custom placeholder.
    EDIT 3: can't be about the starting point, since populating a property with the value of another property that is also on the same metadata card works
Reply

  • Metadata card configuration does not currently support indirect references

    Any news here (apart from what has been pointed out in the thread, that an indirect reference including CurrentUser is possible after "baking" a corresponding Custom Placeholder)?
    If I try an indirect reference in the metadata card configuration it doesn't work - see attached screenshot (this is the case although the concatenation fits the target data type of the property. I know this for sure because if I use another placeholder with incompatible data type, the error message is different).

    Thx 4 any help! :)

    EDIT: I tried this again with other properties, and it worked. I don't know what I did wrong in the past (maybe I did not use the ID of the respective properties, but their aliases, which still does not seem to work), but it looks like at least with certain props indirect referencing works (see reply #10, for instance)
    EDIT 2: Seems like indirection only works if the first level of the chain is a custom placeholder. If I use a normal/ default property I get the error msg "Property XYZ cannot be used as an indirection level". Correct me if I'm wrong, maybe there are other exceptions!
    I guess the reason for this is that the system lacks the information where to start the fetching. If it only knew that the first level is intended to be a property that is also on the metadata card of the object that is to be created! but it seems that it doesnt get this. With a custom placeholder however it is clear for the system what the starting point is. I guess it is even possible to add one or two more indirection levels if the first one is a custom placeholder.
    EDIT 3: can't be about the starting point, since populating a property with the value of another property that is also on the same metadata card works
Children
No Data