Create User License Batch Job

If you ever need to re-create the system standard user license batch job, this can be completed using the following lines of code, in a job.

To create the Automatical Role Assignement batch job use:

SysSecurityDynamicRoleAssignment::createBatchJob();

To create the user licnese miner batch job user:

SysUserLicenseMiner::createBatchJob();

System.InvalidCastException: Unable to cast object of type ” to type ‘Dynamics.Ax.Application.Batchable’.

When programming batch jobs you might encounter the following error message log from a failed to execute batch job:

System.InvalidCastException: Unable to cast object of type ‘<class name>’ to type ‘Dynamics.Ax.Application.Batchable’.

Continue reading