Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Programming - Try to update item journals dimensions from item card dimensions

$
0
0
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;

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>