Hi AX gurus!
I am trying to create a product configured order, and the code works fine when I run it manually, but when I run it through a batch it throws an error.
It seems like its trying to cast a Super(PCAdaptorComponent) class to a Sub (PCAdaptorRootComponent) class.
Heres the error.
: Unable to cast object of type 'Dynamics.Ax.Application.PCAdaptorComponent' to type 'Dynamics.Ax.Application.PCAdaptorRootComponent'.
at Dynamics.Ax.Application.PCXmlParseComponent.Parse(PCClass _component, XmlReader _xmlReader, PCComponentInstanceValue _componentInstanceValue, String _expectedName, PCAdaptorRootComponent _adaptorComponent) in PCXmlParseComponent.parse.xpp:line 131
at Dynamics.Ax.Application.PCXmlParseProductConfigurationModel.Parse(PCProductConfigurationModel _productConfigurationModel, PCProductConfiguration _configuration, String _xmlContainer, PCAdaptorProductConfigurationModel _adaptorProductConfigurationModel) in PCXmlParseProductConfigurationModel.parse.xpp:line 60
at Dynamics.Ax.Application.PCXmlParseConfigurationInstance.Parse(PCProductConfigurationModel _model, PCProductConfiguration _productConfiguration, String _userSelectedValues, String _boundValues, PCRuntimeMode _runtimeMode, PCAdaptor _adaptor) in PCXmlParseConfigurationInstance.parse.xpp:line 43
at Dynamics.Ax.Application.PCExecuteVariantConfiguration.Runbackendconfiguration(Boolean _wdxAutoCalcPrice, Boolean ) in PCExecuteVariantConfiguration.runBackEndConfiguration.xpp:line 23
at Dynamics.Ax.Application.PCExecuteVariantConfiguration.Saveconfiguration() in PCExecuteVariantConfiguration.saveConfiguration.xpp:line 7
at Dynamics.Ax.Application.WdxWebOrder.Create(Int32 salesQty, String userSelectedXml, String boundValueResXML) in WdxWebOrder.Create.xpp:line 96
at Dynamics.Ax.Application.WdxWebOrder.Import() in WdxWebOrder.Import.xpp:line 38
at Dynamics.Ax.Application.WDXTestRunbaseBatch.Run() in WDXTestRunbaseBatch.run.xpp:line 7
at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54
at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13
at BatchRun::runJobStatic(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at BatchIL.taskThreadEntry(Object threadArg)