cancel
Showing results for 
Search instead for 
Did you mean: 

How my addon program can capture a license error exception

former_member244307
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

pedro_magueija
Active Contributor

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