Quantcast
Channel: Microsoft Dynamics NAV Forum - Recent Threads
Viewing all articles
Browse latest Browse all 29197

RE: How to get remaning stock of Item using service ?

$
0
0

Hi,

 

Here is the function that I have created in codeunit-

GetItemQuantity(ItemNo : Code[20];LocationCode : Code[20]) : Decimal

  ItemLedEntry.SETRANGE("Item No.",ItemNo);

  ItemLedEntry.SETRANGE("Location Code",LocationCode);

  IF ItemLedEntry.FINDFIRST THEN REPEAT  

     Qty += ItemLedEntry.Quantity;

  UNTIL(ItemLedEntry.NEXT=0);

EXIT(Qty);  

Where ItemLedEntry is a Record Variable of Item Ledger Entry.

 


Viewing all articles
Browse latest Browse all 29197

Trending Articles