Wednesday, January 23, 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;
    }

Debug batch jobs in Dynamics 365 Finance & Operation / AX 7.0

Sometimes we may need to debug batch jobs execution. In AX 2012 we have to attached Visual Studio to the 'AOS' process and debug the IL code. It's pretty much the same still and got even easier because X++ now is a .NET language. 

So navigate to Debug / Attach To Process in Visual Studio and make sure to select show processes from all users. The batch service has the obvious name Batch.exe (its location is C:\CustomerServiceUnit\DOBind\Packages\Cloud\AosWebApplication\
AosWebApplication.csx\roles\AosWeb\approot\bin – at least on locally deployed machines and this is only for informational purposes, usually you won’t need to know). 

Attach to that process and be able to debug the X++ code that is executed there.




Tuesday, January 22, 2019

Allow multiple transactions within one voucher

General ledger -> Ledger setup -> General ledger parameters -> Ledger > Allow multiple transactions within one voucher.

General that are default set to "No". Set it to yes.



There can only be one vendor or customer transaction per voucher in Dynamics 365 finance and operations 8.0 version

I was getting below error while posting a GL transaction.

There can only be one vendor or customer transaction per voucher 

 To fix this error we need to Allow multiple transactions within one voucher.

General ledger -> Ledger setup -> General ledger parameters -> Ledger > Allow multiple transactions within one voucher.

General that are default set to "No". Set it to yes.






Tuesday, January 15, 2019

Document type to keep attachments of ER configurations has not been defined in ER parameters dynamics 365 finance & Operations

I was getting the below error while generating electronic payment for vendor payments in d365 F&O with 8.0 version.

Document type to keep attachments of ER configurations has not been defined in ER parameters .
The payments cannot be generated

Reason: Documents types are not configures in the Electronic parameters.

Solution:

 Go to Organization administration -> work spaces -> Electronic reporting

Then click on "Electronic reporting parameters" (I'm using 8.0 version with PL 22)




Update "Documents types" in the attachments as shown below.



That's it.

@Rahul

Monday, January 14, 2019

Call Stack in Visual Studio Dynamics 365 Finance & operations

To open the Call Stack window in Visual Studio, from the Debug menu, choose Windows>Call Stack  while debugging your code.




What is the primary purpose of using a Solution in Microsoft Power Platform & ALM?

As organizations embrace low-code development with Microsoft Power Platform , it becomes essential to manage and govern apps, flows, and dat...