Wednesday 23 January 2019

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

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;
    }

7 comments:

  1. What a really awesome post this is. Truly, one of the best posts I've ever witnessed to see in my whole life. Wow, just keep it up. bitcoin leverage trading

    ReplyDelete
  2. Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. OrbitEx

    ReplyDelete
  3. Forex offers many Forex resources such as displaying the current foreign exchange rates, various Forex charts, swap history, economic calendar, pip value calculator, currency converter and margin calculator which can be installed on anyone's website all at no cost. CAD to INR forecast

    ReplyDelete
  4. If your looking for Online Illinois license plate sticker renewals then you have need to come to the right place.We offer the fastest Illinois license plate sticker renewals in the state. http://targetcrypto.co.uk/

    ReplyDelete
  5. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future... eth to inr

    ReplyDelete
  6. Indeed, this made them think what different exercises are useful for those of us who wind up out and about or have restricted gear choices. Samsung Galaxy Tab Active3 Price

    ReplyDelete
  7. Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks! Vivo Y51 Price In Pakistan

    ReplyDelete

Adding a newline into a string in C# and X++

Below is the sample code we can use for  adding a newline after every occurrence of "@" symbol in the string in C#   using System...