InventTrans update

Hi experts,

I want to add a field Manufacturer in purchlines and want the field to get populated when InventTrans is opened through, Inventory> Transactions.

I am using AX 2012… Please help me out with some solutions.

look at \Forms\InventTrans\Data Sources\InventTrans\Methods\transactionCurrencyCode

to show the field (only when it is called from purchLine), check the caller dataset (element.args().dataset() == tablenum(PurchLine)

Thank you for you suggestion, Kranthi.

I might have mislead you, I want to know where to write the code to update inventtrans when I create a purchline.

step one add a field in purchline as and drag it in design step2: now you add a field in invent trans and frag in in its design step2: go to inventrans table there will be method initfrompurchline go there add a code inventtrans.field1=purchline.field1

not sure if the method is there if not you can create a method and pass it with a instance of purchline and assign the purchline value to inventtrans


I wonder why you want to store the Manufaturer per Inventory transactions. It is not a property of the product itself? But if you need to do it, you have to change the class InventMov_Purch. Personally I would not add the field in the InventTrans, but the table InventTransOrigin or InventTransOriginPurchLine. This table contains one record for multiple inventory transaction records.

There are many sources, which will result an inventTrans. So there will not any initFrom* methods at table level.

Rather it is handled by inventMovement and its derived classes.

In this case you need create a new method in inventMovement class which will return an empty value (look at projId method)

Do a forward compile, then the derived classes will know about this change.

Override the above created method in inventMov_Purch and return purchLine.yourfield;

Finally in the \Classes\InventMovement\initInventTransFromBuffer do the assignment,

inventTrans.yourField = this.createdmethod(); (look at projId implementation)

Thank you for your solution Kranthi…

The solution was amazing… It worked. I got to know more about InventMov_* classes…

Once again thank you. keep it up…