11-01-2016 7:55 PM - edited 02-03-2024 5:57 PM
Hi,
I want my addon can capture error when a user tries to open a form which is not allowed under user's current license. I am using ActivateMenuItem() method to open a form from my addon, although I put the code inside a try/catch block but it doesn't capture the exception. According to SDK document, method ActivateMenuItem() should throws an exception when trying to activate system menu items which are disabled. Now SAP just display an error message in the system message log area saying "You cannot open window[60110] Service Call with your current license". My question is that is there a way to capture this error in my addon?
Thanks
Lan
Hi Lan,
Note that it throws when the item is disabled. Disabled does not necessarily mean that you don't have permissions.
You can have an enabled menu item and still not have permission to access a given form.
And it's also possible to have a disabled menu item, and have permission to access a form.
To obtain the permission of a user for a given object you can use the SBObob.GetObjectPermission() method.
You can further manipulate permissions with UserPermissionTree, UserPermissionForms, UserPermission, and Users objects.
There is also a sample on permissions on the SDK Samples directory.
Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
9 | |
9 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.