RE: Data Upgrade - Dimension Set Id for customized tables
Thank you. I tried this the below solution from the above link. But little surprised as its working for few tables & not working for few tables. I have so many tables which has dimensions.Dimension set ID got created for few, but few are still blank.
---No tables update was necessary. I only modify codeunit 104049 Upgrade Dimension Entry - SQL. In the function "UpdateParentTable" I added our tables name to condition for "KeyOffset" set. Again after data upgrade no error was detected and I get new "Dimension Set ID"
Our tables name are Set-off Header, Set-off Line, Debt Adjustment Line, Posted Credit Line.
IF SQLReader.HasRows THEN
WHILE SQLReader.Read DO BEGIN
ParentTableID2 := SQLReader.GetInt32(0); // Parent Table ID
Window.UPDATE(2,GetTableName(ParentTableID2));
IF (ParentTableID2 IN [DATABASE::"Standard Sales Line",DATABASE::"Standard Purchase Line"
,DATABASE::"Set-off Header",DATABASE::"Set-off Line",DATABASE::"Debt Adjustment Line",DATABASE::"Posted Credit Line"]) THEN
KeyOffset := 2
ELSE
KeyOffset := 1;
GetTableKeyFieldArray(ParentTableID2,ParentTableKeyFields);
IF HasTableField(ParentTableID2,DestDimFieldName) AND AreDimKeyAndParentKeyCompatible(KeyOffset) THEN BEGIN
SQLCommand.CommandText := UpdateLedgerEntryTableQry(ParentTableID2,KeyOffset,DestDimFieldName);
SQLCommand.ExecuteNonQuery;
END ELSE
IF NOT AreDimKeyAndParentKeyCompatible(1) THEN
UpgradeErrorLog.SetError(STRSUBSTNO(Text001,DimTableID,ParentTableID2),DimTableID,'');
END;