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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Table 83 - Count in Validate Item No.

(0) ShareShare
ReportReport
Posted on by 693

Hello,

following situation:

Sales Order > Planning > Create Project Order (1 production order with two sales lines):

 

Post output for both lines.

Cancel output line, it is not possible to use Applies-to Entry because there are missing information concerning the Prod. Order Line, like “Prod. Order Line No.” or “Routing Reference No.”

This is caused by the ProdOrderLine.COUNT = 1

Table 83, “Item No.” (OnValidate):

  "Entry Type"::Output:
    BEGIN
    ...  
      IF ProdOrderLine.COUNT = 1 THEN BEGIN
        VALIDATE("Prod. Order Line No.",ProdOrderLine."Line No.");
        "Routing Reference No." := ProdOrderLine."Routing Reference No.";
        "Unit of Measure Code" := ProdOrderLine."Unit of Measure Code";
        "Location Code" := ProdOrderLine."Location Code";
        VALIDATE("Variant Code",ProdOrderLine."Variant Code");
        VALIDATE("Bin Code",ProdOrderLine."Bin Code");
      END ELSE
        "Unit of Measure Code" := Item."Base Unit of Measure";
    END;

  "Entry Type"::Consumption:
    BEGIN
      SetFilterProdOrderComp;
      ProdOrderComp.SETRANGE("Item No.","Item No.");
      IF ProdOrderComp.COUNT = 1 THEN BEGIN
        ProdOrderComp.FIND('-');
        VALIDATE("Prod. Order Line No.",ProdOrderComp."Prod. Order Line No.");
        VALIDATE("Prod. Order Comp. Line No.",ProdOrderComp."Line No.");
        "Unit of Measure Code" := ProdOrderComp."Unit of Measure Code";
        "Location Code" := ProdOrderComp."Location Code";
        VALIDATE("Variant Code",ProdOrderComp."Variant Code");
        VALIDATE("Bin Code",ProdOrderComp."Bin Code");
      END ELSE BEGIN
        "Unit of Measure Code" := Item."Base Unit of Measure";
        VALIDATE("Prod. Order Comp. Line No.",0);
      END;
    END;
...

What is the use of that?

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Jens Glathe Profile Picture
    6,092 on at

    Hi,

    there can be only a link to one prod. order line, that's how it's checked if that's the case. I think the problem with selecting the Applies-to Entry is in SelectItemEntry():

    ...

    SelectItemEntry(CurrentFieldNo : Integer)

    IF ("Entry Type" = "Entry Type"::Output) AND

      ("Value Entry Type" <> "Value Entry Type"::Revaluation) AND

      (CurrentFieldNo = FIELDNO("Applies-to Entry"))

    THEN BEGIN

     ItemLedgEntry.SETCURRENTKEY(

       "Prod. Order No.","Prod. Order Line No.","Entry Type","Prod. Order Comp. Line No.");

     ItemLedgEntry.SETRANGE("Prod. Order No.","Prod. Order No.");

     ItemLedgEntry.SETRANGE("Prod. Order Line No.","Prod. Order Line No.");

     ItemLedgEntry.SETRANGE("Entry Type","Entry Type");

     ItemLedgEntry.SETRANGE("Prod. Order Comp. Line No.",0);

    END ELSE BEGIN

     ItemLedgEntry.SETCURRENTKEY("Item No.",Positive);

     ItemLedgEntry.SETRANGE("Item No.","Item No.");

     ItemLedgEntry.SETRANGE(Correction,FALSE);

    END;

    ...

    Comment out the marked setrange and you'll get a choice.

    with best regards

    Jens

  • Verified answer
    Bianca Profile Picture
    693 on at

    What we did is:

    Change the validate of "Prod. Order Line No."

    ...

    Case "Entry Type" of

     "Entry Type"::Output:

       Begin

         "Routing No." := ProdOrderLine."Routing No.";

         "Routing Reference No." := ProdOrderLine."Routing Reference No.";

         "Unit of Measure Code" := ProdOrderLine."Unit of Measure Code";

         "Location Code" := ProdOrderLine."Location Code";

         "Bin Code" := ProdOrderLine."Bin Code";

         validate("Variant Code", ProdOrderLine."Variant Code");

       END;

    End;

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans