Import from Excel to InventTableModule

Hi I using Axapta version 3.0. In an Excel spreadsheet I have recalculated the new sales prices and now want to import those to the proper places in InventTableModule. Can anyone assist with a detailed how to do guide, please?

HI,Lasse Olesen, I think it is easy to meet your requirement. In InventTableModule table,there are three lines per ItemID in this table,moduletype=0 means invent property(include price etc.),1 means purchase property,2 means sales property. I think you have readied all new prices in excel. so you should do the following steps: 1,create a talbe in axapta, for example tmp_InventTableModule,contains two fields(ITEMID str 30,Price real); 2,import your excel itemid and price to this table;(You have to use the import template,in administration/peridoic/data export/inport); 3,write a job to overwrite the InventTableModule table sales price(moduleType==2) from tmp_inventTableModule. by the way ,if you have any difficulties in writing this job,please contact me feel freely. Wish the above words can help you! Best regard. Andy.PengQingHua from china.

Hi Andy Peng, I have created a table that includes: ItemId ModuleType UnitID Price When I create the table I am not allowed to create without UnitID. It should now be an easy job to copy the values from the current sheet into the the temp_InventTableModule. But I would appriciate you assistance on writing the job to replace the existing prices in InventTableModule. 2 aspects may have to be considered: 1) Some prices are 0 (zero) 2) Not all ItemId are included in the list Will this still be possible?

HI,Lasse Olesen, sorry I am late for answering,Because I am in my vacation. I assume that you have prepared your data like the following format(rember:price is the sales price!): ItemID ModuleType UnitID Price A001 2 PC 100.201 B001 2 PC 0.21 … And then you should create a job use the following codes and run it. I advise you back your database before you run the job!!! static void ImportSalesPrice(Args _args) { temp_InventTableModule temp_InventTableModule; InventTableModule InventTableModule; ; while select temp_InventTableModule { ttsbegin; select forUpdate InventTableModule where InventTableModule.ItemId==temp_InventTableModule.ITEMID && InventTableModule.ModuleType==temp_InventTableModule.ModuleType; InventTableModule.price=temp_InventTableModule.Price; InventTableModule.update(); ttscommit; } } Any problem please contact me! Andy.Peng