Ax32.exe command line parameter -AotImportFile, without deleting sub elements possible?

Question Status

Tom Dc asked a question on 4 Nov 2013 5:01 AM

I import a xpo file via the kernel command parameter -AotImportFile. This deletes sub elements in the same layer. Is there a parameter which says 'do not delete sub elements' when importing the XPO file? Like you have the parameter nocompileonimport.


Dominic Lee responded on 4 Nov 2013 6:31 PM

Hi Tom,

I assume you mean the current customized object in the layer got deleted when you import xpo file.

You can consider import the xpo to the patch layer (e.g. USP) first, then merge the customizations. Finally import the merged objects to the normal layer (e.g. USR)

Best Regards

Tom Dc responded on 12 Nov 2013 5:08 AM

Hi Dolee,

Yes the current customizations at the object got deleted during the import of the XPO file. If you have to first import first into one layer higher, then bring it back to your working layer, you lose some time. In the regular startup command aotimport, you can specify if elements sub elements must be deleted. So if the kernel startup command supports this parameter as well, no extra step has to be performed. The build or import process is executed in a specific order to get the correct modifications on the end model.

I hope that a parameter like 'nodeletesubonimport' will be added in the future as kernel parameter for the 'AotImportFile' kernel command.

Best regards,

Palle Agermark responded on 13 Nov 2013 12:57 AM

AX 2012 R2:

The SysAutoRun.execXpoImport method, which is called when you use this parameter, can take an XML string as input and look for certain attribute value in that. But it doesn't look for a DeleteSubNodes however.

You could add that yourself by looking into how other attributes are handled in the method and add a new call to: import.parmDeleteSubNodes(...);

Maybe this article can help you a bit further with the XML part: This article on TechNet might help you:

Please reply if you need more details on how to move forward.

Dominic Lee responded on 13 Nov 2013 1:26 AM

Didn't pay attention to that option before. Thanks Palle for the information.

And thanks Tom for the question! =)