SBX - Search With Button

SBX - Forum Post Title

How to get GRN of Service item that not invoiced?

Microsoft Dynamics AX Forum

Kavaljeet Singh asked a question on 12 Aug 2018 9:51 PM
My Badges

Question Status

Suggested Answer

Hi all,

I am developing a report GRN not invoiced but i dont know how to pick service item that not been invoiced.

Please help.

Reply
Ali Zeeshan Shaikh responded on 13 Aug 2018 12:57 AM
My Badges
Suggested Answer

Hi Kavaljeet,

As there is no inventory transaction for service item you can use Purchase line status.

Purchline status will tell you whether it is invoiced or not and check the product type which should be service.

You can check the below query which gives you all open or received purchase order lines of service items 

PurchLine       purchline;
InventTable     inventTable;
EcoResProduct   EcoResProduct;
    
while select PurchId, ItemId, PurchStatus from purchline
   where purchline.PurchStatus <= PurchStatus::Received
   && purchline.IsDeleted == NoYes::No
      join ItemId from inventTable
           where inventTable.ItemId == purchline.ItemId
      join RecId from EcoResProduct
           where EcoResProduct.RecId == inventTable.Product
           && EcoResProduct.ProductType == EcoResProductType::Service
{
   info(strFmt("Purchase order: %1 Item Id: %2", purchline.PurchId , inventTable.ItemId));
}

Regards,

Ali Zeeshan

Reply
Ali Zeeshan Shaikh responded on 13 Aug 2018 12:57 AM
My Badges
Suggested Answer

Hi Kavaljeet,

As there is no inventory transaction for service item you can use Purchase line status.

Purchline status will tell you whether it is invoiced or not and check the product type which should be service.

You can check the below query which gives you all open or received purchase order lines of service items 

PurchLine       purchline;
InventTable     inventTable;
EcoResProduct   EcoResProduct;
    
while select PurchId, ItemId, PurchStatus from purchline
   where purchline.PurchStatus <= PurchStatus::Received
   && purchline.IsDeleted == NoYes::No
      join ItemId from inventTable
           where inventTable.ItemId == purchline.ItemId
      join RecId from EcoResProduct
           where EcoResProduct.RecId == inventTable.Product
           && EcoResProduct.ProductType == EcoResProductType::Service
{
   info(strFmt("Purchase order: %1 Item Id: %2", purchline.PurchId , inventTable.ItemId));
}

Regards,

Ali Zeeshan

Reply

SBX - Two Col Forum

SBX - Migrated JS