Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Planning Worksheet and SKU

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

On the Planning worksheet using the 'Calculate Regenerative Plan' I want it to calculate only The Items with Stock keeping Units. I want it to essentially say if there is enough on the Inventory and the Qty on Purch Order than don't  plan this.  I Have added this code.. If there is enough stock it changes the quantity to 0 and is later deleted. How can I:

1) Only make it bring in orders for today date i.e Due date = WORKDATE

2) Filter for lower than workdate 

SETFILTER("Due Date" ,'>%1', WORKDATE);
DELETEALL; ( I've set stand and end date as today on the first screen)

3) Correctly check the SKU quantities to not Plan if there is demand met.. 

IF 1=1 THEN;

CurrentWorkdate := WORKDATE;
Item.CALCFIELDS("Stockkeeping Unit Exists");
IF Item."Stockkeeping Unit Exists" THEN BEGIN
recStockKeepingUnits.RESET;
recStockKeepingUnits.SETRANGE("Item No.", Item."No.");
recStockKeepingUnits.SETRANGE("Variant Code", ReqLine."Variant Code");
IF recStockKeepingUnits.FINDFIRST THEN BEGIN
recStockKeepingUnits.CALCFIELDS(Inventory);
recStockKeepingUnits.CALCFIELDS("Qty. on Purch. Order");
IF (recStockKeepingUnits."Qty. on Purch. Order" + recStockKeepingUnits.Inventory >= recStockKeepingUnits."Reorder Point") OR
(ReqLine."Due Date" <> CurrentworkDate) THEN BEGIN
ReqLine.Quantity := 0;
ReqLine."Quantity (Base)" := 0;
ReqLine.MODIFY;
END;
END;
END ELSE
IF Item."Qty. on Purch. Order" + Item.Inventory >= ReqLine.Quantity THEN BEGIN
ReqLine.Quantity := 0;
ReqLine."Quantity (Base)" := 0;
ReqLine.MODIFY;
END;
// TIO000002 : END

*This post is locked for comments

  • Verified answer
    Rabin Profile Picture
    Rabin 2,976 on at
    RE: Planning Worksheet and SKU

    Hi,

    What is your issue. Can you be specific to the issue rather than presenting your full problem as a question here.

    I would simply go to the Codeunit which is fetching the documents like purchase order and try to add the code there.

    You just need to pass the current record type variable through your condition filter.

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

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans