UIX Samples at Github - should they work?

I tried this one and It does nothing. Both zipped and on folder

https://github.com/M-Files/MFilesSamplesAndLibraries/tree/master/Samples/UIX%20Applications/AlterContextMenuDependingOnSelectedObject

I'm looking for a way to hide items from second mouse click context menu and that sample should get me going if it would do something. Latest M-Files Online.

Cheers

PJ

Parents
  • Hi PJ,

    I have just installed this to my local vault and it seems to work.  If I right-click on a single object then I get a command listed entitled "My command".  If I select multiple objects, or I right-click on a view, then the command is not there.

    Note that this project only targets the M-Files desktop, not anything else.

    Did you install the application and then log out (not just close the window) and log in again?

    Regards,

    Craig.

  • Strange enough, it does work on my local vault as well. I didn't even get a prompt for application to the environment where I try to get it to work. So Samples work.

  • This one hides Create menu from context menu

    shellFrame.Commands.SetCommandState( BuiltinCommand_NewObject, CommandLocation_ContextMenu, CommandState_Hidden );

    Is there a way to hide elements under Create menu like BuiltinCommand_NewObject.141 that would hide creation of object with ID 141 ?

  • I don't believe so.  One thing you could do is react to the "OnBuiltInCommand" event (M-Files UI Extensibility Framework - OnBuiltinCommand Event) and check the parameter provided.  This gives you the object type ID (e.g. 141).  If you return false from this event handler then it effectively cancels the operation.

    So it doesn't hide the option, but it does help stop users using it.

    There may be some non-code options (e.g. to stop the creation of objects of this type via the M-Files Admin), but I assume that you've exhausted those...?

  • OK, so you cannot hide those. Thanks for help again!

Reply Children
No Data