web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Answered

SSRS Report: Is There a Method To Get "Offset Account" from "LedgerJournalTrans.OffsetLEdgerDimension" Similar to LedgerJournalTrans.accountDisplay()?

(0) ShareShare
ReportReport
Posted on by 1,044

Hello Awesome Community! I'm new to AX and reports developments, I'm still learning and I seek your help if you please :)

In this form: General Ledger> Journals> General Journals> Lines

Screen shot:

26555.Capture.PNG 

I want to get the "Offset Account" value as shown: "USMF OPER" so I can get the bank information like bank name.

I did it with the "Account Type" field using LedgerJournalTrans.AccountDisplay() method here is the code:

select LJtrans_local where LJtrans_local.AccountType==LedgerJournalACType::Bank
           && LJtrans_local.Voucher==LJtrans.Voucher;
        select * from BankAT where BankAT.AccountID == LJtrans_local.accountDisplay();

But couldn't do it with the offset account.

Is there a similar method to accountDisplay() that gets me the "Offset Account"? or I have to do it with a query?

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Momochi Profile Picture
    1,044 on at

    I tried getting it with this query but didn't work

    if(LJtrans.OffsetAccountType==LedgerJournalACType::Bank){
                select davCombination where davCombination.RecId == LJtrans.OffsetLedgerDimension;
                select BankAT where BankAT.LedgerDimension == davCombination.RecId;
               }
    
            tempTable.AccountNum   = BankAT.AccountNum;
            tempTable.BankName     = BankAT.Name;


  • Verified answer
    Chandra Wijaya Setiawan Profile Picture
    1,145 on at

    refer to ledgerjournaltrans table below method.

    public LedgerJournalAccountName accountNameFind(

       LedgerJournalACType     _accountType,

       DimensionDynamicAccount _dimensionDynamicAccount,

       SelectableDataArea      _company)

    {

       if (xDataArea::exist(_company))

       {

           changecompany(_company)

           {

               switch(_accountType)

               {

                   case LedgerJournalACType::Ledger :

                       return DimensionStorage::getMainAccountFromLedgerDimension(_dimensionDynamicAccount).localizedName();

                   case LedgerJournalACType::Cust :

                       return CustTable::find(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).name();

                   case LedgerJournalACType::Vend :

                       return VendTable::find(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).name();

                   case LedgerJournalACType::Bank :

                       return BankAccountTable::find(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).Name;

                   case LedgerJournalACType::Project :

                       return ProjTable::find(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).Name;

                   case LedgerJournalACType::FixedAssets :

                       return AssetTable::find(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).Name;

                   case LedgerJournalACType::FixedAssets_RU :

                       return RAssetTable::find(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).Name;

                   case LedgerJournalACType::Employee_RU :

                       return EmployeeTable_RU::findByEmployeeId(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).employeeName();

                   case LedgerJournalACType::RDeferrals :

                       return RDeferralsTable::find(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).Name;

                   case LedgerJournalACType::RCash :

                       return RCashTable::find(DimensionStorage::ledgerDimension2AccountNum(_dimensionDynamicAccount)).Name;

               }

           }

       }

       return "";

    }

  • Momochi Profile Picture
    1,044 on at

    Thank you Chandra for your time and help!

    Using the method you told me about I was able to get the account name that I can equal with BankAccountTable.Name field in the query and then get the bank information.

    This is the code:

    LedgerJournalAccountName   accountName;
    if(LJtrans.OffsetAccountType==LedgerJournalACType::Bank){
                accountName = LJtrans.accountNameFind(LedgerJournalACType::Bank, LJtrans.OffsetLedgerDimension, curext());
                select BankAT where BankAT.Name == accountName;
               }


    Thanks again! :)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans