Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Table 83 - Count in Validate Item No.

Posted on by 689

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

  • Verified answer
    Bianca Profile Picture
    Bianca 689 on at
    RE: Table 83 - Count in Validate Item No.

    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;

  • Jens Glathe Profile Picture
    Jens Glathe 6,092 on at
    RE: Table 83 - Count in Validate Item No.

    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

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans