Ax09 Export Master Items

I had to export the Master Items from one company to another in differing databases as someone made a mistake with the Items and needed them restored, as there were a lot of other changes doing a straight up SQL DB restore wasn’t a good option. So anyway I created a new definition group and added the 3 tables I wanted (inventtable, inventtablemodule and inventitemlocation) to export in the source company, and then replicated that definition group in the target company.

From here you export the definition group to a file as binary this gives you 2 files a file.def and file.dat, one being the layout and the other the actual data. In the target company you then select the definition group and import validating and skipping existing records.

InventDim table won’t be necessary for this exercise as it is required when the InventDimId field on InventItemLocation is not “allBlank”. However should that field not be “allblank” you either have to add the InventDim table to your definition group for export/import or use a job to alter that field once imported to be “allblank”.

An example of such a job is;

static void MWD_UpdateInventDimIdInvItemLoc(Args _args)
{
InventItemLocation itl;
;
ttsBegin;

delete_from itl where itl.inventDimId != ‘ID00000635’;

update_recordset itl
setting
inventDimId = ‘ALLBlank’
where itl.inventDimId == ‘ID00000635’ &&
itl.dataAreaId == ‘ts1’;

ttsCommit;

info(“Processing Finished.”);

}

Leave a Reply