Hi,
I have wrote something in order to take dimension values from item card and update the item journals . It seems that I'm doing something wrong. I have the following but I have error that Dimension set 0 already exists. Can somebody help me please? I'm trying for hours and I can't solve it.
I have 3 global variables that are the following
DefaultDimension Record Default Dimension
DimensionsetEntry Record Dimension Set Entry
TempDimensionsetEntry Record Dimension Set Entry
and my programming code is this
DefaultDimension.RESET;
DefaultDimension.SETRANGE(DefaultDimension."Table ID",27);
DefaultDimension.SETRANGE(DefaultDimension."No.","Item Journal Line"."Item No.");
IF DefaultDimension.FIND('-') THEN
REPEAT
DimensionsetEntry.INIT ;
DimensionsetEntry."Dimension Set ID" := "Item Journal Line"."Dimension Set ID";
DimensionsetEntry."Dimension Code" := DefaultDimension."Dimension Code" ;
DimensionsetEntry."Dimension Value Code" :=DefaultDimension."Dimension Value Code";
TempDimensionsetEntry.RESET;
TempDimensionsetEntry.SETRANGE("Dimension Set ID",DimensionsetEntry."Dimension Set ID");
TempDimensionsetEntry.SETRANGE("Dimension Code",DimensionsetEntry."Dimension Code");
TempDimensionsetEntry.SETRANGE("Dimension Value Code",DimensionsetEntry."Dimension Value Code");
IF NOT TempDimensionsetEntry.FIND('-') THEN
DimensionsetEntry.INSERT;
UNTIL DefaultDimension.NEXT = 0;
I have wrote something in order to take dimension values from item card and update the item journals . It seems that I'm doing something wrong. I have the following but I have error that Dimension set 0 already exists. Can somebody help me please? I'm trying for hours and I can't solve it.
I have 3 global variables that are the following
DefaultDimension Record Default Dimension
DimensionsetEntry Record Dimension Set Entry
TempDimensionsetEntry Record Dimension Set Entry
and my programming code is this
DefaultDimension.RESET;
DefaultDimension.SETRANGE(DefaultDimension."Table ID",27);
DefaultDimension.SETRANGE(DefaultDimension."No.","Item Journal Line"."Item No.");
IF DefaultDimension.FIND('-') THEN
REPEAT
DimensionsetEntry.INIT ;
DimensionsetEntry."Dimension Set ID" := "Item Journal Line"."Dimension Set ID";
DimensionsetEntry."Dimension Code" := DefaultDimension."Dimension Code" ;
DimensionsetEntry."Dimension Value Code" :=DefaultDimension."Dimension Value Code";
TempDimensionsetEntry.RESET;
TempDimensionsetEntry.SETRANGE("Dimension Set ID",DimensionsetEntry."Dimension Set ID");
TempDimensionsetEntry.SETRANGE("Dimension Code",DimensionsetEntry."Dimension Code");
TempDimensionsetEntry.SETRANGE("Dimension Value Code",DimensionsetEntry."Dimension Value Code");
IF NOT TempDimensionsetEntry.FIND('-') THEN
DimensionsetEntry.INSERT;
UNTIL DefaultDimension.NEXT = 0;