InventDim Table Insert and Update of Purchase Order Lines during posting purchase order ??

Hi ,

I have scenario where i need to update the InventDim table with specific location during posting purchase order. I found that new InventDim records are getting added if we change the dimension values during purchase line entry. I want to know where in the code the InventDim record is created during posting of Purchase Order/Packing Slip/Reciepts list etc…

Thank you very much in advance for the help.

purchLine.InventDimId = InventDim::findOrCreate(inventDim).InventDimId; in the validateWrite method of the purchLine will do that while purchLine creation/update.

Can you give more detials on what exactly you are looking for? As the same/changed dimId in registration will flow even in the posting logic…

Kranthi,

Thanks for the Quick reply. Are you saying the system does have the above code to actually create or update InventDim as i could not find the above code in ValidateWrite method of PurchList table.

I want to know where actually in the code , the InventDim inserts/Updates are happening during during Posting Purchase Order/Posting Packing SLip etc…

My case is i want to update the new LocationID in the InventDim table which comes from InventLocation new field which was added by me.

I see in the database the new InventDimIds are getting created.

Thanks for your help.

It is in the form data source(PurchLine) validateWrite method.

So you have added a location field in the InventLocation and you want the purchLine to have the InventDimId with that location.

If that is the case, then you need to update the location dimension while dealing with purchLine, when any action is performed (like warehouse is changed get the location from that table and fill in the correspoding dimension value) which will automatically create a dimId with that(While doing this you also need to check whether the location is enabled for that item(dimGroup))…

Thank you Kranthi… I little bit confused here.

What i did was , created a new field in InventLocation which would have a location (say XX) apart from the default reciept location, default issue location in Ware House Management tab of InventLocation. Now when i go to purchase Order and select the wareHouse (for which i have created this new location field XXX) in PurchLine and click on Post → Purchase Order a new InventDim is getting created with the default location and warehouse (This is currently happening in AX 2009). I want to know where in exactly in the code this is happening.i want to actually create a InventDim record with the new location XX created instead of default location from Invent Location.

You mentioned in the below email that i need to update Location Dimension, do you mean update to InventDimension table only,

Warehouse changed… get the location from that table ?? Which table do you mean here ? Which table do i need to look to see location is enabled for an Item.

Sorry for the long reply… I am new to this …

If that is the case, then you need to update the location dimension while dealing with purchLine, when any action is performed (like warehouse is changed get the location from that table and fill in the correspoding dimension value) which will automatically create a dimId with that(While doing this you also need to check whether the location is enabled for that item(dimGroup))…