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, ...
Suggested Answer

Vendor, ledger dimension value creation using X++

(4) ShareShare
ReportReport
Posted on by 188
Hi experts,
 
I am working on Vendor payment journal creation using excel upload. On the journal line if Account type is "Vendor", I want to place
"Vendor#" on journal line but on LedgerJournalTrans table, field "Vendor#" stores as "LedgerDimension" value.
 
My question if "Vendor" doesn't have ledgerDimension on table "dimensionAttributeValueCombination" then how to generate "Vendor"
ledgerDimension on table "dimensionAttributeValueCombination"?
 
I tried to create Vendor "ledgerDimension" based on following code but the challenge for me in the table "DimensionAttribute", I don't
have name value for Vendor in table "DimensionAttribute".
 
I tried to take name(Table DimensionAttribute) as "SystemGeneratedAttributeVendor" but its not working.
 
********** Code *********
public static LedgerDimensionAccount createDimensionValueForVendor(MainAccountNum _mainAccountId, str _vendor)
{
    MainAccount     mainAccount;
    RecId           hierarchy;
    LedgerStructure ledgerStruct;
    DimensionAttributeValueSetStorage storage = new DimensionAttributeValueSetStorage();
    
    mainAccount = MainAccount::findByMainAccountId(_mainAccountId);
    hierarchy = DimensionHierarchy::getAccountStructure(mainAccount.RecId);
    if (_vendor)
    {
        storage.addItem(DimensionAttributeValue::findByDimensionAttributeAndValue(
            DimensionAttribute::findByName('SystemGeneratedAttributeVendor'), _vendor));
    }
    LedgerDimensionAccount ledgerDimensionAccount =
        LedgerDimensionDefaultingEngine::getLedgerDimensionFromAccountAndDim(
            mainAccount.RecId, hierarchy, storage.save());
    return ledgerDimensionAccount;
}
 
Current  "DimensionAttribute", name values in the system
 
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,031 Most Valuable Professional on at
    The account isn't a dimension and therefore you should be using DimensionAttribute. Do this instead:
    LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber(
        _vendor,
        LedgerJournalACType::Vend);

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans