carry out action message error

knelson997knelson997 Member Posts: 2
I am setting up test data for a new implementation in NAV5.0 In attempting to create a firm planned production order from the planning worksheet, I get the follow error.

"The Production Document Dimension Already Exists."

There are as yet no firm planned production orders in the database.
This could be a setup problem, since this is a new implementation, but I can't figure it out. Has anybody seen this before?

Comments

  • ara3nara3n Member Posts: 9,256
    Run table Production Document Dimension and see if there is actually a record.

    If it is, then the person who cleaned up the db missed this table. if there isn't any record that error mentions, then it's a bug and a developer needs to look at it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • FishermanFisherman Member Posts: 456
    I'm looking at the same error, and I've managed to run it down to a specific area in CodeUnit 99000813, "Carry Out Action".

    In the "InsertProdOrderLine" subroutine, it inserts a new record into the "Production Order Line" table
    ProdOrderLine.INIT;
    ProdOrderLine.BlockDynamicTracking(TRUE);
    ProdOrderLine.Status := ProdOrder.Status;
    ProdOrderLine."Prod. Order No." := ProdOrder."No.";
    ProdOrderLine."Line No." := NextLineNo;
    ProdOrderLine.VALIDATE("Item No.",ReqLine."No.");
    ProdOrderLine.VALIDATE("Unit of Measure Code",ReqLine."Unit of Measure Code");
    ProdOrderLine."Production BOM Version Code" := ReqLine."Production BOM Version Code";
    ProdOrderLine."Routing Version Code" := ReqLine."Routing Version Code";
    ProdOrderLine."Routing Type" := ReqLine."Routing Type";
    ProdOrderLine."Routing Reference No." := ProdOrderLine."Line No.";
    ProdOrderLine.Description := ReqLine.Description;
    ProdOrderLine."Description 2" := ReqLine."Description 2";
    ProdOrderLine."Variant Code" := ReqLine."Variant Code";
    ProdOrderLine."Location Code" := ReqLine."Location Code";
    ProdOrderLine."Bin Code" := ReqLine."Bin Code";
    ProdOrderLine."Scrap %" := ReqLine."Scrap %";
    ProdOrderLine."Production BOM No." := ReqLine."Production BOM No.";
    ProdOrderLine."Inventory Posting Group" := Item."Inventory Posting Group";
    ProdOrderLine.VALIDATE("Unit Cost",ReqLine."Unit Cost");
    ProdOrderLine."Routing No." := ReqLine."Routing No.";
    ProdOrderLine."Starting Time" := ReqLine."Starting Time";
    ProdOrderLine."Starting Date" := ReqLine."Starting Date";
    ProdOrderLine."Ending Time" := ReqLine."Ending Time";
    ProdOrderLine."Ending Date" := ReqLine."Ending Date";
    ProdOrderLine."Due Date" := ReqLine."Due Date";
    ProdOrderLine.Status := ProdOrder.Status;
    ProdOrderLine."Planning Level Code" := ReqLine."Planning Level";
    ProdOrderLine."Indirect Cost %" := ReqLine."Indirect Cost %";
    ProdOrderLine."Overhead Rate" := ReqLine."Overhead Rate";
    ProdOrderLine.VALIDATE(Quantity,ReqLine.Quantity);
    IF NOT (ProdOrder.Status = ProdOrder.Status::Planned) THEN
      ProdOrderLine."Planning Flexibility" := ReqLine."Planning Flexibility";
    ProdOrderLine.UpdateDatetime;
    ProdOrderLine."Shortcut Dimension 1 Code" := ReqLine."Shortcut Dimension 1 Code";
    ProdOrderLine."Shortcut Dimension 2 Code" := ReqLine."Shortcut Dimension 2 Code";
    ProdOrderLine.INSERT;
    

    Immediately following that block, it inserts the dimension values from the planning worksheet into table 358, "Production Document Dimension"
    FromJnlLineDim.SETRANGE("Table ID",DATABASE::"Requisition Line");
    FromJnlLineDim.SETRANGE("Journal Template Name",ReqLine."Worksheet Template Name");
    FromJnlLineDim.SETRANGE("Journal Batch Name",ReqLine."Journal Batch Name");
    FromJnlLineDim.SETRANGE("Journal Line No.",ReqLine."Line No.");
    FromJnlLineDim.SETRANGE("Allocation Line No.",0);
    DimMgt.MoveJnlLineDimToProdDocDim(
      FromJnlLineDim,DATABASE::"Prod. Order Line",
      ProdOrder.Status,ProdOrder."No.",
      ProdOrderLine."Line No.",0);
    

    The Problem is that the code in the OnInsert trigger is also writing these values to the Prod. Document Dimension table, with the exact same values.
    OnInsert()
    IF Status = Status::Finished THEN
      ERROR(Text000,Status,TABLECAPTION);
    
    ReserveProdOrderLine.VerifyQuantity(Rec,xRec);
    DimMgt.InsertProdDocDim(
      DATABASE::"Prod. Order Line",Status,"Prod. Order No.","Line No.",0,
      "Shortcut Dimension 1 Code","Shortcut Dimension 2 Code");
    IF "Routing Reference No." < 0 THEN
      "Routing Reference No." := "Line No.";
    

    Why would they try to write the same records twice in a row? Is this a bug
  • ara3nara3n Member Posts: 9,256
    The Oninsert Trigger is not called.
    ProdOrderLine.INSERT; 
    

    The code looks good to me.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • FishermanFisherman Member Posts: 456
    ara3n -

    When I run this in debug and break prior to the call to INSERT, no records are in the Production Document Dimensions table for the production order lines (two records exist for the header, because they were written in the InsertProdOrder function, which calls InsertProdOrderLines). When I break after the insert on Production Order lines, and review the contents of this table, the records ARE there. If I F8 to step through from that point, the call to the Dimension Management codeunit breaks when it tries to write the records, because the records were already there. I have even commented out the call to Dimension Management from InsertProdOrderLines, and have verified that the records for the lines exist after the transaction completes.

    The call to INSERT() is writing the records to the Production Document Dimensions table. I realize that the "RunTrigger" parameter to INSERT is optional, and that the default is FALSE. This is what is making me think that there is a bug.
  • ara3nara3n Member Posts: 9,256
    Have you done any changes to production order line table?


    If not I would just comment out this and let MS know. I'm guessing you are on 5.0
    DimMgt.MoveJnlLineDimToProdDocDim(
      FromJnlLineDim,DATABASE::"Prod. Order Line",
      ProdOrder.Status,ProdOrder."No.",
      ProdOrderLine."Line No.",0);
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • FishermanFisherman Member Posts: 456
    just FYI - found the issue.

    it has been confirmed that this is an issue by MS. It is available on customersource under hotfixes.
Sign In or Register to comment.