Monday, 25 March 2019

Resolve TFS work item check-in error in D365FO

Recently I have got this error (one or more checked work item failed...) while check-in my source code on TFS but after a little struggle, I have got it fixed.

Please see below images:

Error:


Resolution: (Simply mark it as "associate" instead of "resolve.")


Result:

Job to insert a record of RetailSalesTable using X++ code in D365FO

In this blog, I will discuss how to insert a record of RetailSalesTable using X++ code.

    public static void main(Args _args)
    {
        SalesTable              salesTable;
        RetailSalesTable        retailSalesTable;
        OMInternalOrganization  internalOrganization;

        salesTable = SalesTable::find("SalesOrderNumber");

        select firstonly Name, RecId from internalOrganization
            where internalOrganization.Name == RetailChannelTable::findByRecId(salesTable.RetailChannelTable).name();

        ttsbegin;
        retailSalesTable.RetailChannel = salesTable.RetailChannelTable;
        retailSalesTable.OMInternalOrganization = internalOrganization.RecId;
        salesTable.packRetailSalesTable(retailSalesTable);
        retailSalesTable.insert();
        ttscommit;
    }













That is all.

Monday, 11 March 2019

Preview reports before printing in Dynamics 365 for Finance and Operations

When we want to email a report or to send it to a printer, it would be nice to have a chance to preview it first. I already blogged about the Docentric free-edition tool, which enabled me to customize the email body and add additional email attachments when emailing invoices. The same free add-on for D365FO will also enable us to preview reports before printing.

Let’s demonstrate this on the example of emailing the Customer account statement report (Accounts receivable -> Inquiries and reports -> Customers -> Customer account statement).

Preview before Emailing Reports:

For this example, in the report dialog I have selected one customer for which I want to print the report and I have changed the target print destination to Docentric Email.














In order to preview the report before emailing it, we need to enable "Preview before print" option in the Print destination settings form:


























Now run the report. Preview of the report will appear in the Docentric report viewer.














You have noticed that there are three options available for the user in the Docentric report viewer.
  • Continue printing to Email: It will continue the emailing process.
  • Cancel printing: It will cancel emailing of the report if the user is not satisfied with the preview.
  • Download Email: It will download an email message so that you can open it in your email client and check how it looks like. It is particularly interesting to see how the dynamic content was resolved, for example, email tokens or email additional attachments look.










Preview before Printing Reports:

For previewing the report before printing, we need to set the same "Preview before printing" option as we did in the above section, but this time we need to set this option in Printer Section of the Docentric print destinations settings.




































Now run the report. Preview of the report will be opened in the Docentric report viewer.














You have noticed that there are two options available in Docentric report viewer for Preview before print which will have the same functionality as discussed above.

That is all you need to do to enable this exciting free add-on feature for D365FO which will be very useful in cases when we need to verify or want to preview reports before emailing and printing.

How to Get Customer Free Text Invoice "Totals" form field value with X++ in D365FO

Customer free text invoices are an essential aspect of financial management in D365FO. In this blog, I have compiled all the code needed to ...