Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

how to join MainAccountNumber and financial dimension value using for vendinvoicetrance table

Posted on by Microsoft Employee

hi,

I have written a job to display the main account number and financial dimensions value for the vendinvoicetrans table by using two separate jobs, but I want to do this by a single job and I am unable to join these fields.

Please advise.

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to join MainAccountNumber and financial dimension value using for vendinvoicetrance table

    I have find out the answer .

    static void FinancialdimensionwithMainaccount(Args _args)

    {

       AccountingDistribution                       accountingDistribution;

       VendInvoiceTrans                             vendInvoiceTrans;

       DimensionAttributeValueCombination           dimensionAttributeValueCombination;

       MainAccount                                  mainaccount;

       DimensionAttributeValueSetItemView           dimensionAttributeValueSetItemView;

       DimensionAttribute                           dimensionAttribute;

       while select vendInvoiceTrans

           join accountingDistribution

               where accountingDistribution.SourceDocumentLine == vendInvoiceTrans.SourceDocumentLine

               && vendInvoiceTrans.InvoiceId=='0002-68631' // Provide invoiceid to filter

           join dimensionAttributeValueCombination

               where dimensionAttributeValueCombination.RecId== AccountingDistribution.LedgerDimension

           join MainAccountid from  mainaccount

               where mainaccount.RecId==dimensionAttributeValueCombination.MainAccount

           outer join dimensionAttributeValueSetItemView

               where dimensionAttributeValueSetItemView.DimensionAttributeValueSet == vendInvoiceTrans.DefaultDimension

           outer join Name from dimensionAttribute

               where dimensionAttribute.RecId == dimensionAttributeValueSetItemView.DimensionAttribute

       {

           info(strfmt("InvoiceId - %1,MainAccount - %2,Dimension - %3,Dimension Value - %4",vendInvoiceTrans.InvoiceId,

           mainaccount.MainAccountid,dimensionAttribute.Name,dimensionAttributeValueSetItemView.DisplayValue));

       }

    }

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: how to join MainAccountNumber and financial dimension value using for vendinvoicetrance table

    Hi Jose Mendozaa!

    Can you provide more details about your requirements?

    Maybe this link will be helpful:

    https://community.dynamics.com/ax/f/33/t/298714

    https://community.dynamics.com/ax/f/33/t/295280

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans