web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Inventory Availability report

(1) ShareShare
ReportReport
Posted on by

Hello Experts,

Could you please help me out in Inventory Availability report. I want to filter the report customer wise .

The Customer filter should reflect on Monthly Schedule,Sale Quantity, Gross Requirement.

I am Sending you the following code please see if you can provide any solution to this

if you wants more details please ask.

-----------------CODE----------------------------------------------------------------------------------

OnInitReport()

OnPreReport()
ItemFilter := Item.GETFILTERS;

PeriodText := Item.GETFILTER("Date Filter");

OnPostReport()

Item - OnPreDataItem()
GetCurrentKey := CURRENTKEY;

Item - OnAfterGetRecord()
IF NOT UseStockkeepingUnit THEN BEGIN
IF "Reordering Policy" IN ["Reordering Policy"::Order,"Reordering Policy"::"Lot-for-Lot"] THEN
"Reorder Point" := 0;
CalcNeed(Item,GETFILTER("Location Filter"),GETFILTER("Variant Filter"),"Reorder Point");
END;

Item - OnPostDataItem()

Stockkeeping Unit - OnPreDataItem()
IF NOT UseStockkeepingUnit THEN
CurrReport.BREAK;

SKUPrintLoop := 0;

Stockkeeping Unit - OnAfterGetRecord()
SKUPrintLoop := SKUPrintLoop + 1;
IF "Reordering Policy" IN ["Reordering Policy"::Order,"Reordering Policy"::"Lot-for-Lot"] THEN
"Reorder Point" := 0;
CalcNeed(Item,"Location Code","Variant Code","Reorder Point");

Stockkeeping Unit - OnPostDataItem()

CalcNeed(Item : Record Item;LocationFilter : Text[250];VariantFilter : Text[250];ReorderPoint : Decimal)
WITH Item DO BEGIN
SETFILTER("Location Filter",LocationFilter);
SETFILTER("Variant Filter",VariantFilter);

SETRANGE("Date Filter",0D,WORKDATE);
CALCFIELDS(
"Qty. on Purch. Order",
"Qty. on Sales Order",
"Planning Receipt (Qty.)",
"Scheduled Receipt (Qty.)",
"Planned Order Receipt (Qty.)",
"Purch. Req. Receipt (Qty.)",
"Qty. in Transit",
"Trans. Ord. Receipt (Qty.)",
"Reserved Qty. on Inventory");
BackOrderQty :=
"Qty. on Purch. Order" + "Scheduled Receipt (Qty.)" + "Planned Order Receipt (Qty.)" +
"Qty. in Transit" + "Trans. Ord. Receipt (Qty.)" +
"Planning Receipt (Qty.)" + "Purch. Req. Receipt (Qty.)" + "Qty. on Sales Order";

WITH Item DO BEGIN
IF Item.GETFILTER("Date Filter") <> '' THEN
SETFILTER("Date Filter",PeriodText);
IF Item.GETFILTER("Location Filter") <> '' THEN
SETFILTER("Location Filter",Item.GETFILTER("Location Filter"));

//SETRANGE("Date Filter",0D,31129999D);
GrossRequirement :=
AvailToPromise.CalcGrossRequirement(Item) +
AvailToPromise.CalcOutboundReservations(Item);
ScheduledReceipt :=
AvailToPromise.CalcScheduledReceipt(Item) +
AvailToPromise.CalcInboundReservations(Item);

END;

CALCFIELDS(
Inventory,
"Planning Receipt (Qty.)",
"Planned Order Receipt (Qty.)",
"Purch. Req. Receipt (Qty.)");

ScheduledReceipt := ScheduledReceipt - "Planned Order Receipt (Qty.)";

PlannedOrderReceipt :=
"Planning Receipt (Qty.)" +
"Planned Order Receipt (Qty.)" +
"Purch. Req. Receipt (Qty.)";


//Sale Quantity//


WITH Item DO BEGIN
IF Item.GETFILTER("Date Filter") <> '' THEN
SETFILTER("Date Filter",PeriodText);
IF Item.GETFILTER("Location Filter") <> '' THEN
SETFILTER("Location Filter",Item.GETFILTER("Location Filter"));

CALCFIELDS("Sales (Qty.)");
END;

SaleQuantity := "Sales (Qty.)";

//Sale Quantity End//

ProjAvailBalance :=

Inventory +
PlannedOrderReceipt +
ScheduledReceipt -
GrossRequirement;

// Inventory

CurrentStock :=
Inventory;
//MonthlySchedule

MonthlySchedule := SaleQuantity + GrossRequirement;

Month := CALCDATE('CM');

InvtReorder := ProjAvailBalance < ReorderPoint;
END;

InitializeRequest(NewUseStockkeepingUnit : Boolean)
UseStockkeepingUnit := NewUseStockkeepingUnit;

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    CDsilva Profile Picture
    4,188 on at

    Hi,

    The existing report shows Inventory availability based on Items. If you want to view it based on customers based on the sales cycle it will be a new customized report.

  • Community Member Profile Picture
    on at

    Hi

    Thank you for your answer . Mam can you explain me in details how to proceed.

    Thanks

    Sarabjot

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans