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 :

Fix defaulting main account fixed dimensions precedence in offset main account over default dimensions from primary side

Hichem.Chekebkeb Profile Picture Hichem.Chekebkeb 3,371

I am sure the title is a bit ambiguous but I am sure you will understand the issue after reading the post

The story

I run into a strange case when I set up a fixed dimension for a main account in company specific setup and used it in a transaction. Let me illustrate:

Here I wanted the account Assets to get always BU2 as Business unit dimension value, so I set it as Fixed.

Account1Setup.PNG

But when I used the account as an offset account in a one-line voucher I got unexpected result. The system completely ignored my setup and used the Business unit dimension value from the primary side (left side).

The system has clearly an issue in the order of precedence when defaulting dimension values, and this issue occurs exclusively for one-lined voucher and the account is selected as an offset account. When I tried using multiline vouchers everything met my “logical” expectations.

UnexpectedResult.PNG

Moreover, the surprising and misleading part is that when I discussed this matter in the community, I have been told that the system will pick the fixed value when posting, so I took the courage to post it and see what I get.

Effectively, the system took the value BU2 from the setup! The issue is that, the system ran into a discrepancy between what is seen in the journal line and the actual posted voucher. :S

Discrepancy.PNG

Conclusion

The system has a slight difference between defaulting dimension values precedence logic while booking a voucher and when posting it.

Solution

I took a second courage to dig into dimensions engine and try to fix this issue. Fortunately, it wasn’t that hard.

I found the defaulting logic in LedgerJournalEngine.onOffsetAccountSegmentChanged() method.

The logic picks the values from the primary party then picks values from the main account setup.

SuspectedMethod.PNG

The remark below states it clearly.

TheRemark.PNG

I finally could write some code to give the precedence back to the main account dimension values. You can download the XPO project from here.

I built a new class named HichLedgerJournalEnginePatch then wrote the following methods:

CommonMethod.PNG

DefaultDimMethod.PNG

LedgerDimMethod.PNG

And I changed LedgerJournalEngine.onOffsetAccountSegmentChanged() to look like this:

LedgerJournalEngineMethodPart1.PNGLedgerJournalEngineMethodPart2.PNGLedgerJournalEngineMethodPart3.PNG

Hope this will help anyone running into the same case!

Comments

*This post is locked for comments

  • Hichem.Chekebkeb Profile Picture Hichem.Chekebkeb 3,371
    Posted at

    Thanks Abhijeet!

  • TheAXEffect Profile Picture TheAXEffect 575
    Posted at

    It is really informative. Thank you for digging down to find the root cause of the issue. This is surely helpful :-)