Hi,
am running a batch report to modify the Dimension codes.
dataitem = Dimension Value
OnAfterGetRecord
IF "Dimension Code" = 'NATURE' THEN
BEGIN
IF STRLEN(Code) = 6 THEN
Code := STRSUBSTNO('%1%2%3',COPYSTR(Code,1,3),'0',COPYSTR(Code,4,3));
END;
MODIFY;
On running the report, i get an error like NATURE , 'XXX0XXX' does not exist.
Can you explain y?
0
Comments
You want to modify the CODE field. These field is a part of the primary key.
If you want to change the value of a primary key field, u must use the rename() function.
regards
shud i replace the MODIFY with RENAME(Code)??
Like old records in table Dimension Value (DimValue)
DimensionValueCode,Dimensioncode
KST,789
KST,598
KTR,530
KTR,017
and the second record should be renamed to KST,999:
DimValue.get('KST',598);
DimValue.rename('KST',999);