Showing posts with label dynamics 365 finance and operations. Show all posts
Showing posts with label dynamics 365 finance and operations. Show all posts

Friday, February 5, 2021

Customizing standard report in Dynamics 365 finance and operations

In this article we will introduce how to customize payment advice report. The example will be base on Vendor payment advice. If need apply on Customer payment advice, just need change vend to cust and check same.

1.      Related Objects

Report: BankPaymAdviceVend

Class: BankPaymAdviceVendController, BankPaymAdviceVendPrint, PrintMgtDocTypeHandlerExt

Output MenuItem: BankPaymAdviceVend

2.      Create model

Go to Dynamics 365àModel Management àCreate model


3. Click Next

4. Click Next, Select ApplicationFoundation and ApplicationSuite

5. Create Next and Create new project



6.      From AOT, find Report BankPaymAdviceVend

If you want how to find it is this report. You can find the Payment advice button from payment journal and it’s menu item BankPaymAdviceVendPrint, then you can find it calls class BankPaymAdviceVendPrint, and this class call menu item BankPaymAdviceVend



7. Then menu item calls controller BankPaymAdviceVendController, this controller call report BankPaymAdviceVend.



8. Duplicate the report and rename to BankPaymAdviceVendExt



9. Then Open BankPaymAdviceVendExt and apply the customizations you want.



10. For example:



11.      Deploy report

Right click the project and Rebuild, if no any errors, then Right click the project and Deploy reports



12.      Create a new class that extends the standard controller-- BankPaymAdviceVendController.

Right click ProjectàAddàNew Item…àClass, name BankPaymAdviceVendControllerExt



13. Override main method to specify the controller and report (Copy from BankPaymAdviceVendController and change).

class BankPaymAdviceVendControllerExt extends BankPaymAdviceVendController

{

    public static void main(Args _args)

    {

        SrsReportRunController controller = new BankPaymAdviceVendControllerExt();

        controller.parmReportName(ssrsReportStr(BankPaymAdviceVendExt, Report));

        controller.parmArgs(_args);

        controller.parmShowDialog(false);

        controller.startOperation();

    }

 

}

14.      Add customized report into default payment advice report list in print management.

Add a new class to the project. Name as PrintMgtDocTypeHandlerExt to distinguish it from other object handlers.

Add a delegate handler method to start to use custom report. In this example, extend the getDefaultReportFormatDelegate method in the PrintMgtDocTypeHandlerExt class by using the following code.

class PrintMgtDocTypeHandlerExt

{

    [SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]

    public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)

    {

        switch (_docType)

        {

            case PrintMgmtDocumentType::VendPaymAdvice:

                _result.result(ssrsReportStr(BankPaymAdviceVendExt, Report));

                break;

        }

    }

 

}

15.      Create a extension of output menu item BankPaymAdviceVend


16. Right click and Open it, then change Object property to BankPaymAdviceVendControllerExt


17.      Change print management settings

Go to Accounts payableàFormsàForm setup, on General tab, click Print management

Find payment advice and right clickàNew, select the report you created.


18.      Find a vendor payment journal and try



 Hope this helps !, I will come-up with another interesting topic!

Sunday, December 27, 2020

Setting up alert on specific batch job in case of Error or canceled in Dynamics 365 finance and operations

Alerts are very important events for business and can be created to notify user based on the change. As everyone aware we can setup alert when create , update or delete actions performed on a record or specific field. but we can setup a alert for specific batch job in the system when it Ended , Failed or Cancelled. 

This can be done at the time of setting of the batch job.

Scenario:- 

We have a customer scenario where business user has to be notified when ever "Batch job history clean-up" job end with error or cancelled. 

Steps to configure:- 

1. Go to System Administrator > Periodic tasks >  Batch job history clean-up


























2. If you expand the run in the background section then we can see two options, Recurrence and Alerts. 







































3. Then click on Alerts and setup the events you want alerts to be triggered and click on ok 
4. In this case user fill get notified in the action center when ever the batch job "Batch job history clean-up" ended with error or canceled.
The same alert can be send as email but for that smtp server should be configured in email parameters.



Please note if you want to get alert then "Change based alerts" batch job should be running every min. 

Hope you find this useful and will come up with another interesting blog






Convert Electronic Reporting outbound documents from Microsoft Office formats to PDF in Dynamics 365 finance and operations

 As we aware new feature has been introduced in feature management in Dynamics 365 finance and operations with powerful features. but these features has been not enabled by default. 

Recently we have received a power full feature which coverts all electronic reporting outbound documents from Microsoft Office formats to PDF in Dynamics 365 finance and operations.

Go to System administration > Workspaces > Feature management and enable "Convert Electronic Reporting outbound documents from Microsoft Office formats to PDF" feature




Once we enable this then if you go back to Electronic reporting destination settings, we can see Convert to PDF checkbox enabled.

If you check this checkbox then document will be converted to PDF before we export.












Hope you find this useful and will come up with another interesting blog










Monday, December 21, 2020

Get default dimension name and description in Dynamics 365 finance and operations

I had requirement to get default dimension for Main account and when I look at internet I could see all of them  are so complex to get dimension name and description especially description. 

In fact we don't need all of them because in out of the box we have view which gives all this info by just one select query. if we have Default dimension and dimension. 


This view has method DefaultDimensionView.dimensionDiscription() which gives dimension description.

Please code for your reference, hope you find this useful!  

public static void main(Args _args)

    {

        #define.DimensionName("Department");

        DefaultDimensionView DefaultDimensionView;


        select firstonly DefaultDimensionView

             where DefaultDimensionView.Name == #DimensionName

                && DefaultDimensionView.DefaultDimension == 5637451520;//RecId of default dimension


        info(strFmt('Dimension Name: %1, Dimension description:%2', DefaultDimensionView.DisplayValue, DefaultDimensionView.dimensionDiscription()));

    }



Monday, December 9, 2019

New feature - "Job history cleanup" batch job for Data management and other cleanup routines in Dynamics 365 for Finance and Operations

In this blog I would like to explain about the new batch job introduced in data management to clean up execution history and other list of clean up jobs which are available across modules in Dynamics 365 for Finance and Operations. 

Please check the list of clean up jobs in D365FO in Microsoft blog

And the most awaited clean up job has been released for Data management module (available in Platform update 29 and later), which is very important for most of the business as every business uses Data management (Integration, Data Migration or BYOD etc..) and this should be scheduled to clean up data regularly, else we end up with performance issues.

This “Job history cleanup” clears information from following tables.
    •   All STAGING TABLES
    •   DMFSTAGINGVALIDATIONLOG
    •   DMFSTAGINGEXECUTIONERRORS
    •   DMFSTAGINGLOGDETAIL
    •   DMFSTAGINGLOG
    •   DMFDEFINITIONGROUPEXECUTIONHISTORY
    •   DMFEXECUTION
    •   DMFDEFINITIONGROUPEXECUTION   
The functionality must be enabled in feature management and then can be accessed from Data management > Job history cleanup.


      1.     Please go All workspaces > Feature management and select “Execution history cleanup” and enable.



        2. Once we enable this feature then we should be able to see new tile called "Job history clean up" added to Data management module.








































This can be run as batch job with following parameters setting up.
  •   Number of days to retain history
  •   Number of hours to execute the job
  •   Recurring batch
For more information check Microsoft documentation.

Tags, 

#D365FO, #DataManagement, #CleanUp, #Clear, #DeleteExecutionHistory, #JobHistoryCleanup