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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

x++ code to get business unit form bankaccounttrans please help

(1) ShareShare
ReportReport
Posted on by 2

pastedimage1681310140814v1.png

this is bank account trans form

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: x++ code to get business unit form bankaccounttrans please help

    Hi sachin mittal,

    Use DefaultDimensionView to get the business unit. DefaultDimensionView contains field named "Name" where you can add "Business unit" as a range.

    You can use DefaultDimension field in the view to use as relation.

    Thanks,

    Girish S.

  • Sachin Mittal Profile Picture
    2 on at
    RE: x++ code to get business unit form bankaccounttrans please help

    Can you help with exact code it would be really really helpfull

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: x++ code to get business unit form bankaccounttrans please help

    Can you tell me the navigation of the form.

    Thanks,

    Girish S.

  • Sachin Mittal Profile Picture
    2 on at
    RE: x++ code to get business unit form bankaccounttrans please help

    Form name is AOT > BankAccountTrans   itself then , financial dimension tab

  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: x++ code to get business unit form bankaccounttrans please help

    I guess BankAccountTrans table is related to the form you are asking. If yes then below code helps you.

    DefaultDimensionView dimensionView;
    BankAccountTrans accountTrans;
    
    while select * from accountTrans
        join dimensionView
        where accountTrans.DefaultDimension == dimensionView.DefaultDimension
        && dimensionView.Name == "BusinessUnit"
    {
        info(strfmt("%1,%2,%3",accountTrans.AccountId,accountTrans.Voucher,dimensionView.DisplayValue));
    }

    Thanks,

    Girish S.

  • Sachin Mittal Profile Picture
    2 on at
    RE: x++ code to get business unit form bankaccounttrans please help

    here display value is not found in accounttrans buffer . can you please help

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: x++ code to get business unit form bankaccounttrans please help

    DisplayValue field is in DefaultDimensionView that is dimensionView buffer not in accountTrans buffer.

    Thanks,

    Girish S.

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: x++ code to get business unit form bankaccounttrans please help

    I have written the code wrongly. I have edited the code. Please check.

    Thanks,

    Girish S.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 650 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 582 Most Valuable Professional

#3
CU05031448-0 Profile Picture

CU05031448-0 526

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans