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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

MainAccount Field not showing all main accounts in lookup

(0) ShareShare
ReportReport
Posted on by 4,624

Hi All,

I have created a new Table having two fields :

1. MainAccountNum 

2. AccountName

and also create one normal Relation with MainAccount Table . and i did table compile , CIL and Synchronize . But when i am trying to create new records on table ( for test only) , it is showing like below:

8787.table.PNG

Please suggest what i am missing?

Thanks

Visvash Walia

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi

    I think you use EDT MainAccountNum for new field in your new table.

    If you look EDT you see what the EDT uses lookup form MainAccountLookup.

    For the form set range like:

    _______

    qbr = qbds.addRange(fieldNum(MainAccount, LedgerChartOfAccounts));
    qbr.value(queryValue(LedgerChartOfAccounts::current()));

    ________

    Check LedgerChartOfAccounts and value LedgerChartOfAccounts::current()

    or

    use EDT AccountNum for your new field

  • André Arnaud de Calavon Profile Picture
    301,231 Super User 2025 Season 2 on at

    Hi Visvash,

    What is your current active company? This company should have a Chart of Accounts setup on the Ledger form.

    Or choose another company where the lefger setup is correct.

  • Rohin Profile Picture
    4,624 on at

    Thanks Grigory, I used AccountNum. and it works . Now how to get the value of AccountName when i select AccountNum(MainAccount) ? which table methos need to override?

    Thanks

  • Rohin Profile Picture
    4,624 on at

    Hello Andre,

    Company has charts of accounts but it not works for MAinAccountNum (EDT) and when i took AccountNum(EDT)  as Grigory suggested and make table relation with main account table , it works perfectly. do you have some suggestion why it not works for MAinAccountNum(EDT) ?

  • Verified answer
    Community Member Profile Picture
    on at

    > Now how to get the value of AccountName when i select AccountNum(MainAccount)

    You can override update and insert or modifiedField like

    this.YourFieldName= MainAccount::findByMainAccountId(this.YourFieldAccount).Name;

    Imho

    If you create display method it will be easier in the future

  • Rohin Profile Picture
    4,624 on at

    yes i did by creating one table method "initFromMainAccount" and call it  formDatasource Modified method of AccounNum.

    Thanks a lot Girgory.

  • Rohin Profile Picture
    4,624 on at

    But In the form MainAccount lookup shows duplicate MainAccounts in lookup . please see below:

    8625.form.PNG

    why this is happening?

    Please Suggest

    Thanks

  • Community Member Profile Picture
    on at

    Imho check values of field LedgerChartOfAccounts (table MainAccount) and LedgerChartOfAccounts

    May be you have several Сhart Of Accounts

  • Rohin Profile Picture
    4,624 on at

    Yes we have  two values  Ledgercharts of accounts in MainAccounttable. But we are using only one. how to handle this in lookup of MainAccount in Form ? please suggest

    Thanks

  • Community Member Profile Picture
    on at

    Imho

    1. Check ledger:

    ledger.ChartOfAccounts  = current chart of accounts

    Check ledger.PrimaryForLegalEntity = companyInfo.RecId (companyInfo - current company)

    2. Use EDT MainAccountNum (it's type sets range by chart of accounts)

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans