Get PurchReqId from Purchase Order number in ax 2012




Description : Here I have get PurchReqId from Purchase order number.

Here i have get Purchase requisition number for Purchase order. for your information like which purchase requisition number you have generate Purchase order.

Here i have get Purchase requisition number for Purchase order.

static void PurchRequisitionNum(Args _args)
{
    PurchReqTable ObjPurchReqTable;
    PurchReqLine ObjPurchReqLine;

    ObjPurchReqTable.clear();
    ObjPurchReqLine.clear();
    select * from ObjPurchReqLine where ObjPurchReqLine.PurchId == "YourPurchaseOrderId";
    if(ObjPurchReqLine.RecId != 0)
    {
        select * from ObjPurchReqTable where ObjPurchReqTable.RecId == ObjPurchReqLine.PurchReqTable;
        if(ObjPurchReqTable.RecId != 0)
        {
            info(strFmt("Purchase Requisition Number = %1",ObjPurchReqTable.PurchReqId));
        }
    }
}

Related Posts

Previous
Next Post »

Thanks for comments.....