web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Creating journal entry

(0) ShareShare
ReportReport
Posted on by

Hi experts,

I have a table which has all the data i need to perform and get aggregation amt , end objective is to use this aggregate amount & create 1 JE in 1 company having line items corresponding to multiple accounts from multiple company.

Developing  & using custom methods on table i can generate data like below.

pastedimage1600960371339v1.png

After this i need a code/pseduocode which would do the following

1. Create 1 JE in 1 company 

For example je D01 in company D which will never be present in above list of companies

2.Traverse the above structure & create line items in this JE for respective companies & acc# while ignoring 0 amt transactions.

pastedimage1600960507430v3.png

I think key here will be to map the T1 T2 to Ledger dim value of ledger account in that company , is it something which can be managed in Ax directly or i need to create another column in my table & enter full ledgeraccountdim value so as to map T1 to a ledgerdimvalue as they are not stored as values but only as rec id in dimattribute & displayed as complete value only for display purpose.

Thanks 

Mav

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Mav,

    I would map the main account value in the table and create the LedgerDimension value while creating the JE line in the respective companies.

    The only thing you can look into is if you need any other dimensions to satisfy the account structures setup in those companies.

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Mav,

    What's the aim of making this adjustment?

    Would be great if you could elaborate.

    Many thanks,

    Ludwig

  • Mav Profile Picture
    on at

    The  objective is to create 1 JE & then create multiple line items based on sheet above in that JE for specific accounts (need ledge dimension value for that account)

    I am at a stage where i am able to create JE & line items in JE via  adding that line  items to a list  in x++ job  using my journal create classe, however i cannot create line items for ledger dimension values.

    For example i can create line item via job using my utility to create JE using below code.

    ledgerTransaction.LedgerCode("111001");
    ledgerTransaction.OffsetLedgerCode("999999");

    But not for 

    ledgerTransaction.LedgerCode('10005-009-CMA-00----SA_D-');
    ledgerTransaction.OffsetLedgerCode("999999");

    For not working scenario i tried the following

    ledgerJournalTrans.AccountType = LedgerJournalACType::Ledger
    ledgerDim = DimensionStorage::getDynamicAccount( '10005',ledgerJournalTrans.AccountType);

    But it keeps erroring out  with this message "Function DimensionHierarchy::getHierarchyIdByHierarchyType has been incorrectly called " for line highlighted in red above.

    Upon debugging the error the following has been realized 

    1>

    pastedimage1601310420739v1.png

    It looks for hiearchytype accountstructure in below class & when it does not find it it throws the error.

    pastedimage1601310653576v2.png

    end of that switch case

    pastedimage1601310713325v3.png

    and result from dimenionhiearchy table in sql, so i  think this may get resolved after adding dimensionhiearchy for accountstructure & adding that condition in that switch case.

    Wanted to know will accountstructure be added as systemgeneratedhiearchy like shown below as it appears to be system relaed or custom like main account, how do i add this dimension hiearchy in this table via application , will it be via application directly or i need to write some code to add it , please suggest a fix.

    pastedimage1601310830366v4.png

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Mav,

    it may differ from legal entity to legal entity based on the account structure setup valid for the the particular account.

    You can try the code as per this post. This will be able to find out the dimension hierarchy and set the ledger dimension accordingly

  • Mav Profile Picture
    on at

    Hi,

    I was able to find that in Dixif the following staging to target mapping exists which translates the ledger dimension value in staging to ledger dim value in target , this is exactly what i want my job to do..

    Was able to find the function in the entity class , checking it now hopefully this helps me out.

    pastedimage1601386341178v1.png

    Thanks

    Mav

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Mav,

    You can follow that logic as well, but it is dependent on the dimension setup for the source. You will need to do that in your code as well.

  • Mav Profile Picture
    on at

    Yep that would make it more complex.

    I think i have to pursuit what i mentioned on this post" Mav responded on 28 Sep 2020 9:35 AM "

    Wanted to know will accountstructure be added as systemgeneratedhiearchy like shown below as it appears to be system relaed or custom like main account, how do i add this dimension hiearchy in this table via application , will it be via application directly or i need to write some code to add it , please suggest a fix.

    (Details available in my previous post on 28 Sep 2020 9:35 AM)

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Mav,

    The system gernerated hierarchies are always generated in the system for mom-ledger account types (Customer, Vendor, Fixed assets etc. For a transaction, the DimensionHierarchy records will always be based on the account structure selected for the legal entity.

    Can you tell if the accounts being used in these transactions don't need additional dimensions? In that case, you could create an advanced account rule for these accounts and specify that the dimensions can be left blank for all transactions. This way you won't need to change your code.

  • Mav Profile Picture
    on at

    The accounts being used will be of type ledger

    The accounts will have additional dimensions

    End objective is to create JE with ledgerdimensions.

    Considering that i can ask user to provide full ledger dimension value in a string , how can i use that to ensure that when JE is created that full ledger dimension shows up under accounts .

    Please share.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Mav,

    Can you ask users to put the main account and the dimensions in separate columns? How many dimensions are you dealing with here?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 608

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 591 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 430

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans