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 :

Foreign currency revaluation currencies not showing in drop down in dynamics 365 finance & Operations 8.0

Rahul Kiran Profile Picture Rahul Kiran 481
In the previous versions you can see all currency codes in the currency drop down, but
Dynamics 365 finance and operations 8.0 you don't see all currency codes.

The reason Microsoft changed the logic to see the currency codes only for posted transactions.

In the below example I don't have GL transactions for the selected FROM- TO date. So , that's the reason the currency drop down is empty.





Now I can see the currency codes as I have transactions for the selected date range.




Below is the query filtering currency code.
Classes -> LedgerExchAdj -> constructCurrencySelectionQuery

private Query constructCurrencySelectionQuery()
    {
        Query query = new Query();

        this.setInternalDateRange();

        QueryBuildDataSource qbdsCurrency = query.addDataSource(tableNum(Currency));
        qbdsCurrency.addGroupByField(fieldNum(Currency, CurrencyCode));
        qbdsCurrency.addGroupByField(fieldNum(Currency, RecId));
        qbdsCurrency.addSortField(fieldNum(Currency, CurrencyCode));

        QueryBuildDataSource qbds = qbdsCurrency.addDataSource(tableNum(GeneralJournalAccountEntry));
        qbds.joinMode(JoinMode::ExistsJoin);
        qbds.addLink(fieldNum(GeneralJournalAccountEntry, TransactionCurrencyCode), fieldNum(Currency, CurrencyCode));

        QueryBuildDataSource qbdsHeader = qbds.addDataSource(tableNum(GeneralJournalEntry));
        qbdsHeader.joinMode(JoinMode::ExistsJoin);
        qbdsHeader.addLink(fieldNum(GeneralJournalAccountEntry, GeneralJournalEntry), fieldNum(GeneralJournalEntry, RecId));
        qbdsHeader.addRange(fieldNum(GeneralJournalEntry, Ledger)).value(SysQuery::value(Ledger::current()));

        QueryBuildRange qbr = qbdsHeader.addRange(fieldNum(GeneralJournalEntry, AccountingDate));
        qbr.value(SysQuery::range(fromDate, toDate));

        query.clearAllFields();
        qbdsCurrency.addSelectionField(fieldNum(Currency, CurrencyCode));

        return query;
    }


This was originally posted here.

Comments

*This post is locked for comments