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 :
Microsoft Dynamics AX (Archived)

Slow purchase invoice entry in purchase invoice journal

(0) ShareShare
ReportReport
Posted on by 62

Environment: Dynamics Ax 2012R3CU13
In our France entity, the purchase invoice journal (Accounts payable/Journals/Invoices/Invoice journal) is significantly slower compared to the other entities, f.e. German, Dutch, Swiss. When enabling the SQL trace the following query is the reason for the additional waiting time during invoice entry.
SELECT TOP 1 T1.RECID FROM LEDGERJOURNALTRANS T1 WHERE
(
 (
  (PARTITION=5637144576) AND (DATAAREAID=N'fr')
 ) AND
 (
  (
   ((JOURNALNUM=?) AND
    (
     (
      (TAXGROUP<>?) AND (TAXITEMGROUP<>?)
     ) OR (TAXCODE<>?)
    )
   ) OR (TDSGROUP_IN<>?)
  ) OR (TCSGROUP_IN<>?)
 )
)

In the solution reponse of https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/147168/purchase-order-line-very-slow-update-after-editing the same query is mentioned with a change to the statement, add additional parentheses to the statement.

Somehow this did solve the problem but I don't understand why it did, and changing a standard Ax statement/method is not really upgrade friendly. If I run the query direct in SQL, with the questionmarks replaced with the actual data, it takes 30 seconds to get the result. I tried to add the parentheses in the query but still the query takes 30 seconds, which strikes me as odd. Additional: when I remove the TDSGroup_IN and TCSGROUP_IN from the statement in SQL the result is instant, < 1 second.

Furthermore I have looked into why this code is used in France but not in the other entities, but so far haven't found the parameter, class, or method. One mayor difference between the France entity and the other entities is the setup of Conditional Tax. This is only set for France.

Can the code in LedgerJournalTaxDocument.doTaxGroupExistsForDocument_Server be viewed as a bug? Is code the same in Dynamics 365 F&O?
Does anyone had this issue before and found another reason for the additional delay during purchase invoice entry for a specific entity?
Any information shared regarding my problem is welcome and much appreciated.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Have you already compared the setup of the French with the German invoice journal?

    Are the configurations different for example in regards to the use of number sequences and their allocation at the time of posting?

    Do you have a legal entity in India?

    If this is not the case, can you possibly disable the Indian localizations and see if this results in a performance difference?

    Best regards,

    Ludwig

  • Aartserp Profile Picture
    62 on at

    Hi Ludwig, Thank you for the additional question.

    We do not have an entity in India, nor have we the localization configuration for India enabled. 

    All countries have the same journal setup for the vendor invoice recording. The numbersequence is always set to In connection with balance, all journals have approval activated. No other setup is done on the journal.

    When comparing the German entity with the France entity I only see a difference in the VAT setup (conditional tax) and invoice matching validation (AP>Setup>Parameters>Invoice validation>Enable invoice matching validation. I will test if this will make a difference.

    I will post the result after the test.

    Regards,

    Remco

  • Aartserp Profile Picture
    62 on at

    I've tested all kinds of scenario's and figured out it is the Check sales tax group [General ledger>Setup>General ledger parameters>Sales tax] which makes the application go to LedgerJournalTaxDocument.doTaxGroupExistsForDocument_Server. If the setting is set to None, line 24 of Tax.skipTaxCalculations is activated and through this eventually the query in doTaxGroupExistsForDocument_Server is started.

    For us the setting in Check sales tax group isn't really relevant so we will set this to warning and have the performance issue solved. But since the performance of the query can be increased by adding parentheses it feels this could be reported as a bug, if this code is still relevant in D365 F&O.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans