Showing error during creation of 'dimension set id' in Dimension set entry table.

ManiNav
Member Posts: 120
Hi Everyone,
I am creating 'dimension set id' in temporary dimension set entry table,once its created ,but now its showing its already there.

Please find below my code:
TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'DEPT';
TempDimSetEntry."Dimension Value Code" := DeptCode;
TempDimSetEntry."Dimension Value ID" := DeptID;
TempDimSetEntry.INSERT;
TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'CHANNEL';
TempDimSetEntry."Dimension Value Code" := ChanCode;
TempDimSetEntry."Dimension Value ID" := ChanID;
TempDimSetEntry.INSERT;
TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'PROJECT';
TempDimSetEntry."Dimension Value Code" := ProjCode;
TempDimSetEntry."Dimension Value ID" := ProjID;
TempDimSetEntry.INSERT;
AvailDimSetId := DimensionManagement.GetDimensionSetID(TempDimSetEntry);
DimensionSetEntry."Dimension Set ID" := AvailDimSetId;
PurchaseHeader."Dimension Set ID" := DimensionSetEntry."Dimension Set ID";
IF DimensionSetEntry."Dimension Set ID" =0 THEN
NewDimSetId := DimensionManagement.CreateDimSetIDFromDimBuf(TempDimBuf);
PurchaseHeader."Dimension Set ID" := DimensionSetEntry."Dimension Set ID";
PurchaseHeader.MODIFY;
how, i should give condition to not create dimension set id for above three combination dimension code(Dept,project and channel),if it is already there.
Please guide me regarding above query.
Thanks,
Mani.
I am creating 'dimension set id' in temporary dimension set entry table,once its created ,but now its showing its already there.

Please find below my code:
TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'DEPT';
TempDimSetEntry."Dimension Value Code" := DeptCode;
TempDimSetEntry."Dimension Value ID" := DeptID;
TempDimSetEntry.INSERT;
TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'CHANNEL';
TempDimSetEntry."Dimension Value Code" := ChanCode;
TempDimSetEntry."Dimension Value ID" := ChanID;
TempDimSetEntry.INSERT;
TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'PROJECT';
TempDimSetEntry."Dimension Value Code" := ProjCode;
TempDimSetEntry."Dimension Value ID" := ProjID;
TempDimSetEntry.INSERT;
AvailDimSetId := DimensionManagement.GetDimensionSetID(TempDimSetEntry);
DimensionSetEntry."Dimension Set ID" := AvailDimSetId;
PurchaseHeader."Dimension Set ID" := DimensionSetEntry."Dimension Set ID";
IF DimensionSetEntry."Dimension Set ID" =0 THEN
NewDimSetId := DimensionManagement.CreateDimSetIDFromDimBuf(TempDimBuf);
PurchaseHeader."Dimension Set ID" := DimensionSetEntry."Dimension Set ID";
PurchaseHeader.MODIFY;
how, i should give condition to not create dimension set id for above three combination dimension code(Dept,project and channel),if it is already there.
Please guide me regarding above query.
Thanks,
Mani.
0
Best Answers
-
Hi,
is your TempDimSetEntry really Temporary=Yes?
Also, according to my understanding, DimensionManagement.GetDimensionSetID will only return 0 if no dimension/values are provided. If the ID did not exist before, it will create the necessary entries in the DB, so no need for calling CreateDimSetIDFromDimBuf. (And where did you fill TempDimBuf anyway?)5 -
Hi Vaprog/Everyone,
I fixed the above issue.
I filtered then create,and removed CreateDimSetIDFromDimBuf function as vaprog guide,now its working fine.
Like:(StagingtoPI: staging table,from where data is taking)
IF StagingtoPI.Department <> '' THEN BEGIN
TempDimSetEntry.RESET;
TempDimSetEntry.INIT;
TempDimSetEntry.VALIDATE("Dimension Code",'DEPT');
TempDimSetEntry.VALIDATE("Dimension Value Code",DeptCode);
TempDimSetEntry.VALIDATE("Dimension Value ID",DeptID);
IF NOT TempDimSetEntry.INSERT THEN TempDimSetEntry.MODIFY;
END;
did for all three dimension code(Dept,project and channel).
Thanks for the help.
Mani.0
Answers
-
Hi,
is your TempDimSetEntry really Temporary=Yes?
Also, according to my understanding, DimensionManagement.GetDimensionSetID will only return 0 if no dimension/values are provided. If the ID did not exist before, it will create the necessary entries in the DB, so no need for calling CreateDimSetIDFromDimBuf. (And where did you fill TempDimBuf anyway?)5 -
Hi Vaprog,
Thanks for your reply.
Yes,TempDimSetEntry, property: Temporary=Yes.
As,you advice above: no need for calling CreateDimSetIDFromDimBuf. so, i removed this, but i am getting the same error as above.
Please guide me further,how i can overcome this issue.
(And where did you fill TempDimBuf anyway?:-I created temporary=yes,for dimension buffer table,and its updating 'dimension set id' in dimension set entry table inside the createDimSetIdFromDimBuf function.so,atlast i assigned that 'dimension set id' to purchase header.)
Thanks,
Mani.0 -
Hi Vaprog/Everyone,
Please help me regarding above query.
Thanks,
Mani.0 -
Hi Vaprog/Everyone,
I fixed the above issue.
I filtered then create,and removed CreateDimSetIDFromDimBuf function as vaprog guide,now its working fine.
Like:(StagingtoPI: staging table,from where data is taking)
IF StagingtoPI.Department <> '' THEN BEGIN
TempDimSetEntry.RESET;
TempDimSetEntry.INIT;
TempDimSetEntry.VALIDATE("Dimension Code",'DEPT');
TempDimSetEntry.VALIDATE("Dimension Value Code",DeptCode);
TempDimSetEntry.VALIDATE("Dimension Value ID",DeptID);
IF NOT TempDimSetEntry.INSERT THEN TempDimSetEntry.MODIFY;
END;
did for all three dimension code(Dept,project and channel).
Thanks for the help.
Mani.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions