Customization Analysis Report D365FO



Customization Analysis Report D365FO



What is the Customization Analysis Report?

The Customization Analysis Report is a tool that analyzes your customization and extension models and runs a predefined set of best practice rules. The report is one of the requirements of the solution certification process. The report is in the form of a Microsoft Excel workbook.

How to generate the report

To generate the Customization Analysis Report, run the following command in a development environment.


xppbp.exe -metadata=<local packages folder> -all -model=<ModelName> -xmlLog=C:\BPCheckLogcd.xml -module=<PackageName> -car=<reportlocation>


Open Command Prompt and run the below script... please change the path as per your environment folder hierarchy.

CD C:\AOSService\PackagesLocalDirectory\Bin






I have 4 Submodels in my Main module... You can check in below screenshot.




Module
  1.      SLDTaxationSuite
Model
  1. SLD_Taxation_Suite
  2. SLD_Ext_Common_Resource_PAK
  3. SLD_Ext_Taxation_PAK
  4. SLD_Ext_Taxation_Reports_PAK

So I need to create 4 different scripts for all models.


Model :  SLD_Taxation_Suite

xppbp.exe -metadata=C:\AOSService\PackagesLocalDirectory -all -model="SLD Taxation Suite" -xmlLog=C:\Car\Log\BPCheckLog_SLD_Taxation_Suite.xml -module="SLDTaxationSuite" -car=c:\CAR\SLD_Taxation_Suite.xlsx


Model :  SLD_Ext_Common_Resource_PAK

xppbp.exe -metadata=C:\AOSService\PackagesLocalDirectory -all -model="SLD Ext Common Resource PAK" -xmlLog=C:\Car\Log\BPCheckLog_SLD_Ext_Common_Resource_PAK.xml -module="SLDTaxationSuite" -car=c:\CAR\SLD_Ext_Common_Resource_PAK\SLD_Ext_Common_Resource_PAK.xlsx


Model :  SLD_Ext_Taxation_PAK

xppbp.exe -metadata=C:\AOSService\PackagesLocalDirectory -all -model="SLD EXT TAXATION PAK" -xmlLog=C:\Car\Log\BPCheckLog_SLD_EXT_TAXATION_PAK.xml -module="SLDTaxationSuite" -car=c:\CAR\SLD_EXT_TAXATION_PAK\SLD_EXT_TAXATION_PAK.xlsx


Model :  SLD_Ext_Taxation_Reports_PAK

xppbp.exe -metadata=C:\AOSService\PackagesLocalDirectory -all -model="SLD Ext Taxation Reports PAK" -xmlLog=C:\Car\Log\BPCheckLog_SLD_Ext_Taxation_Reports_PAK.xml -module="SLDTaxationSuite" -car=c:\CAR\SLD_Ext_Taxation_Reports_PAK\SLD_Ext_Taxation_Reports_PAK.xlsx





Please feel free to contact me if you are facing any issues during the following the above blog.



Record sorting D365FO, AX 7 and AX-2012


Record sorting D365FO, AX 7 and AX-2012


Today, I got requirement to perform sorting on form with table data source while inserting records..



SLDOffsetTaxDS_DS.query().dataSourceName(formDataSourceStr(SLDOffsetTax,SLDOffsetTaxDS)).addSortField(fieldNum(SLDOffsetTax, Priority), SortOrder::Ascending);

SLDOffsetTaxDS_DS.query().dataSourceName(formDataSourceStr(SLDOffsetTax,SLDOffsetTaxDS)).addSortField(fieldNum(SLDOffsetTax, CountryRegionId), SortOrder::Ascending);

Vendor Aging Report D365FO


Vendor Aging Report D365FO


As we all know customization in Vendor Aging reports or Customer Aging reports is a nightmare.
The same thing I faced in the previous week. when a task was assigned to me to debug the vending Report.


Report elements


 I have done some research in two days on this and found the below information:


1)      Using CustVendTable Map and VendTable Query: Inserting data into CustVendTransAging Table.
(Referà  Class : VendBalanceList :: calculateDetailsForMultiple ->> CustVendAgingCalculation à process method à insertCustVendData() method.


2)      Inserting data into CustVendAgingProcessingTmp table using VendTrans and VendSettlement Tables.
( Refer à Class : CustVendAgingCalculation àselectTransactions()  à selectOpenTransactions() and selectClosedTransactions() methods .


3)      Inserting data into CustVendAgingProcessingDetailsTmp from CustVendAgingProcessingTmp Table
( Refer à Class : CustVendAgingCalculation à selectDetailsOfTransactions()
   Inserting data into CustVendAgingCalculatedTmp using CustVendAgingProcessingTmp Table and CustVendAgingProcessingDetailsTmp Tables.
( Refer : Class : CustVendAgingCalculation:Process method).

5)      Inserting data into VendTmpAccountSum Table using CustVendAgingCalculatedTmp.
(Refer : Class ::VendBalanceList: insertIntoTmpAccountSum())


6)      Inserting data into VendAgingReportTmp Table (which is the main temporary table used for populating data in the report) using VendTmpAccountSum and CustVendTransAging tables.(VendAgingDP class)


I would request you to debug and check the classes above and tables and that would help you get more information.

Class Extension D365FO



Class Extension D365FO


In this blog I will show you class extension in D365 and add new method in the existing class without any over-layer..


There are two way to create Extension of the existing class...


  1. Static Class 
  2. ExtensionOf



Static class 

Create a new public static class use the name pattern ClassName + _Extension

You can use the following code for reference....
public static class SLD_PaymFee_Extension
{
  
        public static void paymfeeFind(PaymFee _this)
        {
            /// You can write your code here

            _this.findFees(); //Use _this to call methods from the base class;
        }


}


ExtensionOf

Create new class add the annotation of ExtensionOf and enter the class name... In this type of extension add final keyword. 

[ExtensionOf(classStr(PaymFee))]
final class SLD_PaymFee_Extension
{
  
        public static void paymfeeFind(PaymFee _this)
        {
            /// You can write your code here

            _this.findFees(); //Use _this to call methods from the base class;
        }


}


For verification you can use the below code

class SLD_DemoClass
{

     
    public static void main(Args _args)
    {
        PaymFee obj =new PaymFee();
        obj.paymfeeFind();
    }

}


Label Extension D365FO

Label Extension  D365FO



As We, All know Label Extension is not available in D365FO in the same way we use to create form, Table, and class Extension...


You can check the below screenshot Label extension option is gray/disable in the menu.



What is the resolution?

There is a way to create an extension of Existing label files.
Add a new label file like the below image... In my demo, I am Creating an Extension of the Sys Label file. 

In Extension use Prefix of Existing Label File name then Add _Extension as Postfix




In my case file name was Sys_Extension. Now click on Add button and complete the wizard.


Select the Language is in use by Parent Label file and click on next ...



You can create a new Label and override the existing one, For Demo purposes, I have created Two Labels @SYS456 which is New Label, and the second I created @SYS12 which is already Exists in SYS Label File... We created this one to override the existing Label.





Now I have created a Menu Item and assign the @SYS456 Label to Menu Items...





To handle the Override case, I have created a class for the verification...

class SLD_DemoClass
{

     
        public static void main(Args _args)
    {
   
        info(SysLabel::labelId2String2(literalstr('@SYS12'), 'en-US'));
        info(SysLabel::labelId2String2(literalstr('@SYS456'), 'en-US'));
    }

}




Performance Tool in D365FO


Performance Tool in D365FO
Today, I found standard feature of performance optimization in Dynamics 365 For Finance and Operations ....

Microsoft called this feature as Performance tool


You can find the navigation of this tool as below... 


You will find lots of option here to optimization, Over internet I didn't find any documentation of this feature. So I am sharing some items i have explored.

There is Text box where we can Enter of  the number of records on which we want to check performance using this tool.


Microsoft Divide this Feature in 4 Category

  1. Data  Manipulation
  2. Query
  3. Temp DB & In Memory
  4. Cache 


Data Manipulation

In this MS Checking the performance of 
Insert  
Update
Record Insert List
 Insert Record set
update record set
delete from


Query

In this section testing will perform on the below points


  1. Large Buffer read
  2. Cluster Index
  3. Unique index with cache hit
  4. Unique index without cache hit
  5. Non-Unique Index

Temp DB & In Memory

In this section we can check the performance on Temp DB and In Memory....  

Cache

The same number of records will store in cache ...


Important 
Note that running for 1,000 records will take approximately 1 minute, so be careful using larger numbers not to run into form timeouts. The max record count is 100,000.

FormHasMethod extension in D365FO

 FormHasMethod extension in D365FO


Every developer who has started working on D365FO faces this issue that when we create a method in the form of Extension

For verification of method exists or not in the run time, we can use Global::formHasMethod but it does not work with form extensions

So I advise everyone to use the below code is working... 


Source Link


using  System.Object;
using  Microsoft.Dynamics.Ax.Xpp;
using  System.Reflection;
    [ExtensionOf(classStr(Global))]
 final class Global_Extension
{
    static boolean formHasMethod(FormRun _fromRun, IdentifierName _methodName)
    {
        boolean flag= next formHasMethod(_fromRun_methodName);

        if (flag==true)
        {
            flag= Global::VerifyformExtensionHasMethod(_fromRun_methodName);
        }

        return ret;
    }

    private static boolean VerifyformExtensionHasMethod(FormRun _formRun, IdentifierName _methodName)
    {
        

        try
        {
            System.Object[] extensions = ExtensionClassSupport::GetExtensionsOnType(_formRun.GetType(), true);

            if (extensions)
            {
               System.Type    formExtensionType;
               MethodInfo    mInfo;
             
                var  bindingFlags = BindingFlags::Public | BindingFlags::Static | BindingFlags::IgnoreCase;

                for (int i = 0; i < extensions.Length; i++)
                {
                    formExtensionType= extensions.GetValue(i);

                    var info = formExtensionType.GetMethods(bindingFlags);

                    for (int J = 0; J < info .get_Length(); J++)
                    {
                        mInfoinfo .getValue(J);
                        if (mInfo.Name == _methodName)
                        {
                            return true;
                        }
                    }
                }
            }
        }
        catch (Exception::CLRError)
        {
            error(CLRInterop::getLastException().ToString());
        }

        return false;
    }

}



Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...