Hi all,
I need to be able to import and export data from table BusinessEventsConfiguration via the Data management framework so I created all objects needed for this via this table right click option "Addins" ->"Create data entity".
When I tried to build this in project I get the following compile error:
Cannot generate chain of command subscription inialization code for 'BusinessEventsConfiguration'.'insert'. Exception: 'Object reference not set to an instance of an object.' at: at IKVM.Reflection.Emit.ModuleBuilder.GetTypeToken(Type type)
at IKVM.Reflection.Emit.ILGenerator.Emit(OpCode opc, Type type)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorPass3Worker.EmitChainOfCommandSubscriptionsCode(Parameters parameters, IXppcMetadataProvider metadataProvider, NetModuleNameByTypeName netModules, FileRollbackHandler fileRollbackHandler, IDiagnosticSink diagnosticsHandler).
And also this

Then I renamed the data entity and staging table (by adding the prefix Mcs) and the compile error was gone. The error from the picture above remained. The export worked as expected but on import the data is filled in the staging table and after this error appear:
Results. Error executing code: McsBusinessEventsConfigurationEntity table does not have method '__doInsert'. for insert of new records and
Results. Error executing code: McsBusinessEventsConfigurationEntity table does not have method '__doUpdate'. for updating.
The code goes in run time error in class DMFEntityBase, method insertUpdate, lines _target.insert(); or _target.doInsert(); or _target.update(); or _target.doUpdate(); depending whether the parameter for validation on Entity structure is set and whether it should insert or update the base table.I have not added nor overrided any methods on entity or staging table.
I checked the windows Event viewer and there is only the same error as above.
I have seen similar standard ax entities that work as expected, for example CustBillingClassificationCodeEntity. The only difference is that table BusinessEventsConfiguration has property Save Data per Company set to No.
Any idea why this happens?