Views:
Applies to Product - Dynamics 365 Commerce
 
What’s happening?
User is unable to view parameters for a batch job, which is necessary to determine the effect on the system. An error is logged indicating a casting issue related to the SalesTable, stating that a container was packed with more fields than defined in the table.
 
Reason:
The error "Unable to cast object of type 'System.Int32' to type 'Microsoft.Dynamics.Ax.Xpp.Common'" occurs when there is a mismatch between the number of fields packed in the batch job parameters and the number defined in the metadata. This can arise if there have been changes to the batch job parameters list without maintaining the old version.
 
Resolution:
To resolve this, the following steps can be taken:
- Recreate the batch job to use the latest parameters list.
- Alternatively, use a CoC extension to handle both old and new versions of the parameters list.
- If the parameters were unique to the job and cannot be recreated from memory, it is necessary to disable (delete) the failing jobs and create new ones to resolve the issue.