Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

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

(1) ShareShare
ReportReport
Posted on by 60
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 60 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 74,036 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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans