Friday, December 21, 2018

LS NAV - Create an Out of Stock Report


  • Custom Report in NAV
    • Datasets
      • T27 Item
        • T10012209 Replen. Out of Stock Log (Dataitemlink on No.)
    • Filters
      • Custom Filters for StartDate and EndDate
    • Layout
      • Group by Item
      • Group by Location
        • Total Days out of stock
        • Total % of time out of stock for date range selected
        • Total Count of Times item went out of stock in period
    • Globals
      • StartDate Date 
      • EndDate Date 
      • CalcDaysOOS Integer 
      • CalcDateOut Date 
      • DaysInRange Integer 
      • PCDaysOOS Decimal
    • CAL
Documentation()

OnInitReport()

OnPreReport()
DaysInRange := EndDate - StartDate;

OnPostReport()

Item - OnPreDataItem()

Item - OnAfterGetRecord()

Item - OnPostDataItem()

Replen. Out of Stock Log - OnPreDataItem()

Replen. Out of Stock Log - OnAfterGetRecord()
CalcDaysOOS := 0;

IF "Date Out of Stock" < StartDate THEN BEGIN
  CalcDateOut := StartDate;
END ELSE BEGIN
  CalcDateOut := "Date Out of Stock";
END;


IF "Date In Stock" <= DMY2DATE(1,1,1900) THEN BEGIN
  CalcDaysOOS := EndDate - CalcDateOut;
END ELSE BEGIN
  CalcDaysOOS := "No. of Days Out"; 
END;

PCDaysOOS := CalcDaysOOS / DaysInRange;

Replen. Out of Stock Log - OnPostDataItem()

No comments:

Post a Comment