Recently I came across the following exception while executing a batch job via a menu item. The batch job has been written using the SysOperation Framework.
To fix this, please follow the steps below:
- Create Code Permission
- Link it with the menu item
Create a new code permission under AOT > Security > Code Permissions. Add a server method for the newly created code permission. Specify the following properties for the server method added:
- Class: Your SysOperation service class
- Method: Method name to invoke
- EffectiveAccess: Invoke
- ManagedBy: Manual
Now link your code permission with the menu item which is used to trigger the batch job. Use LinkedPermissionType and LinkedPermissionObject properties to achieve it! This should be resolving the exception.