Inventory transactions are not generated for new PO lines in ax2012 : reg

Dear All,

I am having one customization for my client, in which I am having additional field in Std Purch line like Suppl. Item ID and Suppl item Qty. For every item , I am giving one item as supplementary item. then by using a button click method , i am creating a new Purch Line for the Supplementary Item id mentioned in the previous Line record. It happens in a format as mentioned below:

  1. PO header Create.

  2. For the above PO, a main item is created through std. method, additionally supplementary item id, & item qty for this main item id mentioned in this line.

  3. then the main item is selected and a calculate supplementary item button is clicked.

  4. on button click, a new purch line is created with supl. item details as main item details.

Here I am facing one Issue. For the Purch line created through std code, Inventory transactions are shown ., while for the purch line with suppl item , the system is showing no Inventory transactions.

please tell how to resolve this Issue.

Thanks in advance,

Bharat V

this functionality is already available in AX 2012. i hope there is no need for customization.

correct me if i am wrong.


guru sankar k

Yes Guru Shankar , You are right. this functionality is already available in AX 2012. but the client does not want to use it. He wants to give the supplementary items at the PO level itself. For every PO main item he wants to define a supplementary Item , its Price & Supply Qty. Therefore this kind of Customization necessitated.Please tell me how to bring data on the Inventory transactions view in PO Lines


Bharat V

I am working on a particular customization for my client, where i need to add supplementary items to every main item created in the Purch line. The client does not want to to use the Std Suppl itemCreate Classes & its functionality. Therefore I added two extra field in the Purch line ( 1. Supplementary Item, & 2. Its qty). Then on click of a button I am creating a new record in the datasource level and entering the desired values. After this all the Purchase order related functions are working properly. But the supplementary item for which I created a record through code, there is no Inventory Transaction, It is not getting enabled even for the registration process. For your Reference I giving the code what i have written at the button click method.

void clicked()

int updatereccount = 0, newreccount = 0 , containersize;
PurchLine buffer,updatebuffer, purchline3, newrecbuffer;
ItemId _itemid;
boolean ret = true;

if (ret == true)


glbbuffer = conNull();
buffer = Purchline_ds.getFirst(1);
while(buffer.RecId != 0)
if((buffer.SupplementaryItemId != “”) && (buffer.SuppItemQty >= 1) && (buffer.SupplUnit != “”))
glbbuffer += buffer.SupplementaryItemId; //1
glbbuffer += buffer.SupplUnit; //2
glbbuffer += buffer.SuppItemPrice; //3
glbbuffer += buffer.SuppItemQty; //4
glbbuffer += buffer.RecId; //5
buffer = Purchline_ds.getNext();
containersize = conLen(glbbuffer);
while(containersize != 0)
_itemid = conPeek(glbbuffer,1);

select forUpdate updatebuffer where updatebuffer.PurchId == Purchline.PurchId
&& updatebuffer.ItemId == _itemid
&& updatebuffer.PurchItemType == PurchItemType::Suppitem;
updatebuffer.PurchQty = conPeek(glbbuffer,4);
updatebuffer.PurchPrice = conPeek(glbbuffer,3);
updatebuffer.PurchUnit = conPeek(glbbuffer,2);
updatebuffer.ParentItem =conPeek(glbbuffer,5);



PurchLine.ItemId = conPeek(glbbuffer,1);
PurchLine.PurchUnit = conPeek(glbbuffer,2);
PurchLine.purchprice = conPeek(glbbuffer,3);
PurchLine.PurchQty = conPeek(glbbuffer,4);
PurchLine.ParentItem = conPeek(glbbuffer,5);
PurchLine.PurchItemType = PurchItemType::Suppitem;
PurchLine.PurchaseType = PurchaseType::Purch;
PurchLine.PurchStatus = PurchStatus::Backorder;
PurchLine.ProcurementCategory = EcoResCategory::find(EcoResProductCategory::findByItemIdCategoryHierarchyRole(PurchLine.ItemId,EcoResCategoryNamedHierarchyRole::Procurement).Category).RecId; // bharath as on 27/06/2013*/
// element.CreateInventtransPostingVoucher();
// element.insertInventtrans();

glbbuffer = conDel(glbbuffer,1,5);
containersize = conLen(glbbuffer);
// buffer = Purchline_ds.getNext();


Box::info(strFmt(“For %1 Purchase Order %2 Records updated & %3 Records created”,buffer.PurchId,updatereccount,newreccount),“Purchase Order”);


Please tell how to resolve this issue.

Thanks & regards

Bharat V

Dear Bharat, please contact me on my Skype Account may b I can help you for this supplementary items. contact me on my Skype ID.