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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Function DimensionValidationRequest::newForLedgerDimensionType has been incorrectly called inD365 F&O

(0) ShareShare
ReportReport
Posted on by

Good morning everyone, 

I would be greatful if you can help me. 

In fact, I developed a process related to the Inventory Module, which allows the user to transfer articles between warehouses adding the needed charges and taxes. 

In this process, the user posts the Movement Journal, then my code creates a journal (MCRLedgerJournal) with its lines.
In the lines, there is a field named Account Num containing something like this : 638410-DV06-FS01-LC019---0392.  I was asked to create this field on the base of the financial dimensions in the movement journal (default dimension of InventJournalTrans) and combine it with the account from the markup/tax. That way,  a new ledger account combination is created. 

Problem : 

We have two environments, Test and Prod. with same version of D365 for Finance & Operations. The problems only exists in the environement of Prod.

When posting the Movement Journal ,this error occurs. 

Function DimensionValidationRequest::newForLedgerDimensionType has been incorrectly called 

The error shows up randomly. The same user, had this error and he couldnt post the journal. After two days, he succeeded at posting the same journal without changing anything. 

This is how I create the combination : LedgerDimensionFacade::serviceCreateLedgerDimension(markupTable.CustomerLedgerDimension,
inventJournalTrans.DefaultDimension). 

I would appreciate your help. 

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

    Hi,

    This error means that there is an issue with the Ledger dimension format that you are passing.

    Could you please share the entire code change that you have done?

  • Community Member Profile Picture
    on at

    // the header

    select markupTable where markupTable.MarkupCode == 'TransVillC';

    journalTable.parmLedgerJournalTable(ledgerJournalTable);

           journalTable.parmMCRCCGeneralLedgerId();

           journalTable.parmLedgerAccountType(LedgerJournalACType::Ledger);

           journalTable.parmLedgerOffsetAccountType(LedgerJournalACType::Ledger);

           journalTable.parmExchRate();

           journalTable.parmCurrencyCode();

           journalTable.parmLineNum();

           journalTable.parmLedgerAccount(inventJournalTable.LedgerDimension);

           journalTable.parmledgerOffsetAccount(inventJournalTable.LedgerDimension);

           journalTable.parmTransDate(inventJournalTrans.TransDate); // modifié le 07-3

           journalTable.parmTransTxt();

    // lines

    journalTable.createLedgerJournalTrans(roundedValue,0,LedgerJournalACType::Ledger);

    select firstonly forupdate ledgerJournalTrans order by RecId desc;

                   if(ledgerJournalTrans.JournalNum == ledgerJournalTable.JournalNum)

                   {

                       ttsbegin;

                       Voucher = ledgerJournalTrans.Voucher;

                       ledgerJournalTrans.OffsetLedgerDimension = 0;

                       mainAccountRetrived = int642Str(markupTable.CustomerLedgerDimension);

                      ledgerJournalTrans.LedgerDimension = LedgerDimensionFacade::serviceCreateLedgerDimension(markupTable.CustomerLedgerDimension,

               inventJournalTrans.DefaultDimension);

                       ledgerJournalTrans.TransDate = inventJournalTrans.TransDate;

                       ledgerJournalTrans.update();

                       ttscommit;

                   }

    the inventJournalTrans is passed as a parameter to this method.

    When I debugg and pass the cursor over variables markupTable.CustomerLedgerDimension and inventJournalTrans.DefaultDimension, it contains the right values.

    But what I cannot understand is, if the ledger dimension format is wrong then why had the same user succeeded at posting the same journal?

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Were there any changes done to the account structure before user could post the journal successfully?

  • Suggested answer
    Community Member Profile Picture
    on at

    Hello,

    No.

    Thank you very much for your reply.

    In fact, we tried to clear the cache and it worked. the error does not appear anymore.

  • Suggested answer
    SouravDam Profile Picture
    11,730 on at

    Please check in below forms if the sequence is set same in both.

    -- Configure account structure.

    -- Financial dimension configuration for integrating applications.

    Example below for ACC structure.

    813280.JPG

    Example for integrating applications.

    55144.JPG

    Regards,
    Sourav

  • Community Member Profile Picture
    on at

    Hi thanks again for your reply.

    In fact, the sequence is not set same in both form. I have "MainAccount" missing in the second form (Financial dimension configuration for integrating applications.)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans