Options

Dimensions Prod. Order Components

ignasijuanignasijuan Member Posts: 21
HI: I'm with the NAV16 version and using Global dimension 1 and Global dimension 2 to define two dimensions associated with Items.
Each Item has two dimensions by default and these must be of the type 'Same code'.
When I create a production order, the dimensions of the Prod. Order Line are placed correctly with the dimensions that correspond to the Item to be manufactured.
But when I check the lines of components I see that the dimensions are those of Prod. order line rather the dimensions corresponding to the Items components.
That is so because the table 5407 Prod. Order Component, when the Item No. is validated will trigger a local procedure CREATEDIM:

LOCAL CreateDim(Type1 : Integer;No1 : Code[20])
TableID[1] := Type1;
No[1] := No1;
"Shortcut Dimension 1 Code" := '';
"Shortcut Dimension 2 Code" := '';

ProdOrderLine.GET(Status,"Prod. Order No.","Prod. Order Line No.");

"Dimension Set ID" :=
DimMgt.GetDefaultDimID(
TableID,No,'',"Shortcut Dimension 1 Code","Shortcut Dimension 2 Code",
ProdOrderLine."Dimension Set ID",DATABASE::Item);


In the call to DimMgt.GetDefaultDimID among other parameters is passed a SourceCode as a ‘Blank’ and the SetID from Prod. Order Line.
At the end the system returns the dimensions of the Prod. Order line (passing a SourceCode blank, cannot be defined priorities).
Is this correct?
Must components lines have the dimensions of the production order line, when these dimensions depend on the product?
¿Could be called the function with a non-blank SourceCode, and define priorities with this SourceCode?.
Thank you.

Comments

  • Options
    ignasijuanignasijuan Member Posts: 21
    I've tried to define a Source Code 'OPCOMP' and define a priority 1 for this Source Code and table 27, but the comparison that is made in the GetDefaultDimID procedure in the codeunit 408 DimensionManagement:


    IF DefaultDimPriority1.GET(SourceCode,DefaultDim."Table ID") THEN BEGIN
    IF DefaultDimPriority2.GET(SourceCode,TempDimBuf2."Table ID") THEN BEGIN
    IF DefaultDimPriority1.Priority < DefaultDimPriority2.Priority THEN BEGIN

    TempDimBuf2.DELETE;
    TempDimBuf2."Table ID" := DefaultDim."Table ID";
    TempDimBuf2."Entry No." := 0;
    TempDimBuf2."Dimension Value Code" := DefaultDim."Dimension Value Code";
    TempDimBuf2.INSERT;
    END;
    END ELSE BEGIN
    TempDimBuf2.DELETE;
    TempDimBuf2."Table ID" := DefaultDim."Table ID";
    TempDimBuf2."Entry No." := 0;
    TempDimBuf2."Dimension Value Code" := DefaultDim."Dimension Value Code";
    TempDimBuf2.INSERT;
    END;



    DefaultDimPriority1 and DefaultDimPriority2 are the same record, both with priority 1 so the condition

    IF DefaultDimPriority1.Priority < DefaultDimPriority2.Priority THEN BEGIN

    is not true and the result is the same (dimensions are from Prod Order Line)
    Note that the indentations are not clear in the post but the condition ends the three IF's.
    (See the original code from these procedure).

    :'(

  • Options
    ignasijuanignasijuan Member Posts: 21
    Any idea?
Sign In or Register to comment.