In the previous article we already discussed the topic Query Based SSRS Report creation in Microsoft Dynamics 365 Finance and Operations. There you can see all the necessary steps to configure and generate query based SSRS reports in Microsoft Dynamics 365 Finance and Operations.
In this article i will show you How to create Custom Table Methods Through Extension in Microsoft Dynamics 365 Finance and Operations. If you are a beginner You can also access this free VM from Microsoft learning portal, read the article Microsoft provides a VM Mode for a free,web based virtual machine environment for D365 F&O Learners.
Imagine a requirement that you have add one more column to the all sales orders grid view under the Accounts Receivable menu.
The All sales order form showing the list of all sales order summaries with the columns Sales Order refer no, Customer Account, Customer Name , Order type , Invoice account etc...Here we need to display one more extra column TotalSales which gives the total sales value of each sales order.
For adding one extra column in All Sales order grid view, we have to create one custom table method by extending the SalesTable. This method is also know as Display Method.
Create a Model
Create a class
Here we are creating one class named SalesTable_Extension which extending the table SalesTable. In D365 sales header details are stored in SalesTable and associated sales transaction details stored in SalesLine Table. The reference key for the tables are SalesId .
Extend the form
All the core steps are completed now. Method getTotalSalesOrderAmount() returns the TotalSales value of each Sales Orders. Next step we have to create one more column in the GridView of the form SalesTableListPage which lists all the sales orders summary.
For this create extension of the form SalesTableListPage, for this right click SalesTableListPage from AOT and click on create extension. After few second the form is extend to the project. see the below image for more clarification.
Add TotalSales Column
After creating FormControl field with Real Data Type go to the property window, change the Name property of FormControl to SalesTotal. Also change the DataSource, here SalesTable is the data source and put the display method getTotalSalesOrderAmount() as the Data Method.In X++ for calling a static Data Method is by using the syntax,
ClassName :: MethodName();
0 Comments:
Post a Comment