Skip to Content
0

How my addon program can capture a license error exception

Nov 01, 2016 at 07:55 PM

45

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Pedro Magueija Nov 02, 2016 at 04:13 PM
1

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

LinkedIn | Twitter | Blog

Share
10 |10000 characters needed characters left characters exceeded