Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 64797

Customer account is missing in general ledger entry by Using X++

$
0
0

Today I was facing a strange problem. I use ledger entry for customer code which was freely available on different blog. You can find the same code here, which I used it two years ago.

http://tech.alirazazaidi.com/create-and-post-vendor-invoice-journals-x-dynamics-ax-2012/

This code will work perfectly fine. We create ledger entry for different customer and our customization is working fine. But when we create ledger entry for newly created customer. Ledger entry successfully created but customer account was not populated. More interestingly if we create or manually update same ledger entry for same customer account, the rest of customization works fines for same customer.

When I struck and no way out, I queried to NDA AX group, Only André Arnaud de Calavon

Replied with hint. Problem was that Customer account must exist in DimensionAttributeValueCombination.

When we create a ledger entry first time for customer, Ax create first customer entry in DimensionAttributeValueCombination table. Then go for Ledger entry.

After writing code, searched finally I found that following statement works for me.

DimensionStorage::getDynamicAccount(_CustTable.AccountNum, LedgerJournalACType::Cust);

 

This statement, search Ledger dimension, if found it will return otherwise will create and return.

Why I love Dynamics Ax, Because, ERP is so vast that every day new challenge and every day something new for learning.


Viewing all articles
Browse latest Browse all 64797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>