Skip to main content

Notifications

Business Central forum
Answered

I want to enter (Dimension Set Entry) in the (General Journals) In the right way

Posted on by 58
hi for all
 
I want your help in this case
 
I want to enter (Dimension Set Entry) in the (General Journals) screen and I have a dimension called (EMPLOYEE) I want to enter the dimension on (EMPLOYEE) and this is proven in the code but the strange thing is that it enters the dimension on (VEHICLES) and this is wrong and I want (EMPLOYEE)
 
 
 
 
This is my code
 
 
After execution, it gives me this message as in the picture
 
 
I chose in the code the dimension I want is (EMPLOYEE), but when executing it chooses the dimension (VEHICLES)????
 
 
 
I want the dimension (EMPLOYEE) and the employee number (104)
 
.؟؟؟؟؟
 
  • Verified answer
    CU09091051-0 Profile Picture
    CU09091051-0 58 on at
    I want to enter (Dimension Set Entry) in the (General Journals) In the right way
    Thank you very much Mr. YUN ZHU  because you always help me, and I am very happy that I benefit from your experiences.
     
    I got inspired from the following code links and the problem was solved.
     
     
                    DimensionCode := 'EMPLOYEE';
                    DimEmployee := '104';

                    IF (DimEmployee <> '') AND (DimEmployee <> '0') THEN BEGIN
                        IF NOT DimensionSetEntries.GET(0, DimensionCode) THEN BEGIN
                            DimensionSetEntries.INIT;
                            DimensionSetEntries.Validate("Dimension Code", DimensionCode);
                            DimensionSetEntries.Validate("Dimension Value Code", DimEmployee);
                            DimensionSetEntries.INSERT;
                        END;
                        DimensionSetID := DimMgt.GetDimensionSetID(DimensionSetEntries);
                        GenJournalLine.Validate("Dimension Set ID", DimensionSetID);
                    END;
                   
                  GenJournalLine.Insert();
     

    Thank you very much
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 71,471 Super User 2024 Season 2 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,888 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,247 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans