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, we can see the currency codes as the transactions available in the system between 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;
}
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, we can see the currency codes as the transactions available in the system between 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;
}