SBX - Search With Button

SBX - Forum Post Title

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

Microsoft Dynamics AX Forum

Jose Mendozaa asked a question on 8 Nov 2018 10:23 PM
My Badges

Question Status

Verified

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.

Reply
Suggested Answer

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

Reply
Jose Mendozaa responded on 12 Nov 2018 6:55 AM
My Badges
Verified Answer

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));

   }

}

Reply
Jose Mendozaa responded on 12 Nov 2018 6:55 AM
My Badges
Verified Answer

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));

   }

}

Reply
Suggested Answer

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

Reply

SBX - Two Col Forum

SBX - Migrated JS