We have Dimensions as : Department, Country Code, Project Code and Product Code. User wants to take Product wise, Analysis By Dim report in Service Contract.
In Service Contract module, there is no dimension at Service Contract Line level. So what I did, created Shortcut Dimension 1 Code, Shortcut Dimension 2 Code and Dimension Set ID fields in Service Contract Line table. Wrote code to update Product Code. It is working fine.
Now I want to update this Product Code in Service Line table. But when we Create Invoice from Contract, Department, Country Code and Project Code is already creating. Now what I want to do is update my Product Code dimension along with these three dimensions. How can I achieve it? I do not want to overwrite these three dimensions.
Thanks in Advance.
You need to extend your dimension set that you already have in the service invoice. All the functions for this are in the DImensionManagmenet codeunit.
1. Copy dimension set entries into a temporary table
2. Add / update the new value of the product code in the temporary buffer
3. Create a new dimension set
TempDimSetEntry.VALIDATE("Dimension Code",DimVal."Dimension Code");
TempDimSetEntry.VALIDATE("Dimension Value Code",DimValCode);
TempDimSetEntry.VALIDATE("Dimension Value ID",DimVal."Dimension Value ID");
NewDimSetID := DimMgt.GetDimensionSetID(TempDimSetEntry);