D365FO One Box VM SQL Password


D365FO One Box VM SQL Password


We can open SQL Server Management Studio on you D365FO Local machine Via Windows Authentication and Using SQL server Authentication...


Window Authentication 

For windows Authentication you have to open SQL server as Run as Administrator otherwise you will get authentication Error...


SQL Server Management Authentication

For SQL server Authentication, Use below user name & password

USERNAMEAOSUSER
PASSWORDAOSWebSite@123


Support Faryal's Cusine


Passing values between PreHandler & PostHandler



Passing values between PreHandler & PostHandler 


using the below code you can pass the custom value between pre handler and post handler


Example


  /// <summary>
    /// enforcePayRateTolerance pre event hanlder
    /// </summary>
    /// <param name="args">Event args</param>
    [PreHandlerFor(tableStr(HRMCompFixedPlanTable), tableMethodStr(HRMCompFixedPlanTable, enforcePayRateTolerance))]
    public static void HRMCompFixedPlanTable_Pre_enforcePayRateTolerance(XppPrePostArgs args)
    {
   

        args.addArg("Tolerance", "Sheikh Sohail Hussain");

    }







 Example
    /// <summary>
    /// enforcePayRateTolerance post event hanlder
    /// </summary>
    /// <param name="args">Event args</param>
    [PostHandlerFor(tableStr(HRMCompFixedPlanTable), tableMethodStr(HRMCompFixedPlanTable, enforcePayRateTolerance))]
    public static void HRMCompFixedPlanTable_Post_enforcePayRateTolerance(XppPrePostArgs args)
    {
      

        if (args.existsArg("Tolerance"))
        {
           Info( args.getArg("Tolerance"))

     
        }
    }

Support Faryal's Cusine


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.



Support Faryal's Cusine


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);

Support Faryal's Cusine


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.

Support Faryal's Cusine


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();
    }

}


Support Faryal's Cusine


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'));
    }

}




Support Faryal's Cusine


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...