Tuesday, November 18, 2025

Delete caches in Dynamics 365 F&O

In Dynamics 365 Finance and Operations (D365 F&O), clearing the Application Object Tree (AOT) cache usually involves running specific utility functions through the user interface or a URL, or performing actions in a development environment. There is no single "Clear AOT Cache" button in the standard UI. 

From the User Interface (Functional Users/Admins)

You can clear various server-side caches, including those related to AOT elements and extensions, using a specific page in the application. 

  1. Navigate to the utility page by modifying your D365 F&O URL. Append 

·       mi=sysclassrunner&cls=sysflushaod

·       mi=sysclassrunner&cls=sysflushdata

·       mi=sysclassrunner&cls=sysflushdictionary

to your base D365 F&O URL.

    • Example: https://[yourD365URL]/?cmp=USMF&mi=sysclassrunner&cls=SysFlushAod
  1. Alternative UI Method (if TMS is enabled): Navigate to Transportation management > Setup > Load building > Load building strategies and click the Generate class list button. This action internally calls SysFlushAod::main() and flushes several caches. 

In a Development Environment (Developers)

In a development environment (Dev VM), a full build and synchronization of the related model is the standard way to ensure AOT changes are reflected, which implicitly handles caching issues related to code changes. 

  • Build and Synchronize: In Visual Studio, after making changes, right-click your project or model in the Application Explorer and select Build and then Synchronize database.
  • Clear Visual Studio Cache: Sometimes, Visual Studio itself caches data. You can delete the files in the ComponentModelCache folder at: C:\Users\[YourUser]\AppData\Local\Microsoft\VisualStudio\[Version]\ComponentModelCache

 Happy Daxing...


Monday, June 30, 2025

How to stop updating existing records while importing Data through Data Management Framework (DMF)

Problem Statement : I was working on a requirement involving file-based integration using the Data Management Framework (DMF). The data entity includes a defined primary key, and as per standard DMF behavior, if a record with the same key already exists during import, it is updated.

However, the requirement is to prevent updates to existing records. Instead, the DMF process should skip such records and continue processing the remaining records in the file without interruption.

Solutions: One of possible solutions is setting the DB operation to None if it’s Update. For example:

public void mapEntityToDataSource(DataEntityRuntimeContext _entityCtx, DataEntityDataSourceRuntimeContext _dataSourceCtx)

{

// Call the base method

        next mapEntityToDataSource(_entityCtx, _dataSourceCtx);

        

        // Add your custom logic here

if (_dataSourceCtx.getDatabaseOperation() == DataEntityDatabaseOperation::Update)

{

_dataSourceCtx.setDatabaseOperation(DataEntityDatabaseOperation::None);

}

}


Happy Daxing :)

Wednesday, June 11, 2025

Enable / Disable form control through COC

 [ExtensionOf(formStr(FormName))]

final class FormName_Extension

{

    /// <summary>

    /// control visibility of form control flag based on Company parameters

    /// </summary>

    public void init()

    {

        next init();


        FormStringControl   Indicator = this.design().controlName(formControlStr(FormName, TableName_Indicator));

      

      

        if(Indicator  && curExt() ==  'YourCompany')

        {

            Indicator .visible(True);

        }

        else

        {

            Indicator .visible(false);

        }

    }

}


Happy DAXing ... :)

Monday, November 25, 2024

Use Chain Of Command with Examples

 Dear Friends

Here is an example of using Chain of Command for form datasource methods.

[ExtensionOf(formDataSourceStr(<<Form Name>>, <<Datasource Name>>))]

final class FormName_DataSourceName_ModelName_Extension

{

    public int active()

    {

        int ret ;

        ret = next Active();

        // Get current selected record.

        TableName Buffer = this.cursor();

        FormButtonGroupControl ControlObject; 

        ControlObject= this.formrun().design().controlName(formControlStr(<<FormName>>, <<ControlName>>)) as FormButtonGroupControl; //Initialized the Form control

// Validation logic

if(InventTransArchiveProcessHistoryTable.IsCustomProcess == NoYes::Yes)

        {

             ControlObject.visible(false);

        }

        else

        {

            ControlObject.visible(True);

        }

        return ret;

    }

}


Happy Daxing...

Wednesday, May 01, 2024

Enable UAT database over OneBox DevTest environment using JIT

 Dear Friends,

In this Article I will show you how to enable UAT database access for Development machine using just-in-time (JIT). Many times when something is not working as expected case in a Microsoft Dynamics 365 Finance and Operation environment and it would helpful to look at the underlying data that may not be visible on a form or report etc. Here are the detailed steps of How  to enabling Just-In-Time(JIT) Database Access over Development Machine?

  •  Go to the LCS and select project -> Full detail menu of Standard acceptance test section from right sidebar.


  • Go to Maintain Dropdown and select Enable access for using mentioned pc access only.


  • Add for access of those network public IP because of firewall rules. 


  • Select AzureSQL Source and mention Name for access purpose. Google your public IP address and add in Source address prefix.


  •  Now little Scroll down and add Database Account. Select Performance tuning for AX (write to AX) for read and write access of UAT database. Mention detail purpose for access of database. Submit Request Access.


  • Copy SQL Server\Database Name, Username, Password.


  • Open SSMS and setup all details as per notepad like Server name Login username and password in Login Tab. Add Database in Connection Properties Tab.


  • If you want also to connect your UAT database with your Dynamics 365 Finance and Operation. Go to K:/Service Volume ->AosService ->WebRoot. First backup copies your default Web.config file. Open Web.config file as a administrator to make save changes.


  •  Ctrl F and then find DataAccess.SqlPwd. Then find four line for changing the data access. Change Database, DbServer, SqlUser and SqlPwd as per notepad. 


  • Restart your World Wide Web Service from Services and reload your dynamics 365 Finance and Operation you have loaded all data as per UAT. Now you can easy to debug your customization with UAT data.
For more details refer: Microsoft Documentation

Happy DAXing ... 😀

Tuesday, April 16, 2024

Copilot Customization with Plugins

 Dear Friends,

As, we know Microsoft Copilot helps as a personal assistant for work, helping with various tasks such as writing, summarizing, researching, and more. To retrieve and process new and real-time information, especially data that's specific to organization and workflows, Copilot requires plugins.

 

We can develop plugins that use the OpenAI schema to add custom functionality to Microsoft Copilot experiences, by connecting our own application data to Microsoft Copilot. Microsoft Copilot is unable to retrieve real-time information from third-party services. Plugins can extend the capabilities of Microsoft Copilot by retrieving real-time information, to allow users to interact with the information in a natural way.

 

Microsoft Copilot uses the following process flow when the user starts conversation with query and Copilot answers the query by searching for and extracts info from plugin:

 



 

Benefits

  • Plugins can retrieve information or perform tasks on behalf of a user.
  • Plugins enhance the user experience by providing additional features and functionalities. Users can interact with plugins directly within the chat interface, making it a seamless part of their workflow.
  • Copilot plugins can call connected services, perform actions, and provide answers without complex conversation flows. By enabling the Microsoft 365 Copilot setting in the Power Platform admin center, we can seamlessly connect tenant and Power Platform environment.
  • The plugin ecosystem encourages community contributions. Developers can create and share plugins, fostering collaboration and innovation.

In summary, plugins empower Copilot to do more, enhance user interactions, and provide real-time insights. They’re a valuable addition to the Copilot ecosystem!

 

Future

Microsoft is working on extensibility options of Copilot for Microsoft 365 cloud. This extensibility also requires different licenses. For e.g., Copilot development with Copilot Studio is part of the Microsoft Copilot license. If the plugin uses Power Platform Connectors, users require a Power Platform license to use them.

In future, we can expect that Copilot analyzes input prompts, leverages machine learning techniques to generate content, and utilizes relevant data to fill in plugin parameters for executing commands.

 For more details refer: Microsoft Documentation

Happy DAXing ... 😀

Tuesday, April 26, 2022

How to hide "Page" and "Filter" while embedding a Power BI report in PowerApp

 Dear Friends,

Power platform is becoming a essential part of any Dynamics implementation. You might have observed that when you will embed a Power BI report in PowerApp or any other  web page using an iframe, it will show page name and side right filter with the report in the PowerApp/web page. It doesn't look good but how can we hide both page name and filter from the report? 


Solution is very simple. You need to add embedURL + "&filterPaneEnabled=false&navContentPaneEnabled=false" to hide both page name and filter bar from the report. Please remove highlighted text from URL if you want to see the both section in your embed PowerBI report.




Happy DAXing....😊

Wednesday, June 23, 2021

Different ways to deploy SSRS Reports in Dynamics 365 Finance and Operations

 Dear Friends,

There are two ways to deploy the SSRS reports in D365 for finance and operation. 

  1. The first choice should be to deploy the report directly from Visual Studio
    • Open the Build menu, click Deploy. Alternatively, in Solution Explorer, right-click the report project and then click Deploy.
    • In Solution Explorer, right-click the report and then click Deploy
  2. Lastly, we can deploy the reports using PowerShell.
    • Open Windows PowerShell in Admin mode and execute the below commands as per requirement.
    • For deploying all SSRS reports
K:\AosService\PackagesLocalDirectory\Plugins\AxReportVmRoleStartupTask\DeployAllReportsToSSRS.ps1 -PackageInstallLocation “K:\AosService\PackagesLocalDirectory”
    • For deploying the specific report
K:\AosService\PackagesLocalDirectory\Plugins\AxReportVmRoleStartupTask\DeployAllReportsToSSRS.ps1 -Module ApplicationSuite -ReportName <ReportName> -PackageInstallLocation “K:\AosService\PackagesLocalDirectory”
    • (Replace <ReportName> with required report name such as RetailLabel.Report or *Retail* – this will deploy all reports containing ‘Retail’ in report name)
Happy DAXing....😊

Friday, June 18, 2021

Cloud offering details for Dynamics 365 Finance and operations

 Dear Friends,

Every cloud implementation of D365 Finance and operations offers three types of environments.

Tier-1 environment: Tier 1 environments include Develop and test boxes. As a standard MS provides one develop/test instance for the duration of the subscription. This instance is a non-production single-box instance and can be used for Development OR Unit testing OR an automated build environments. Customer can purchase additional develop/test instances separately as an optional add-on. Provisioning for Tier-1 occurs When the Design phase starts. The provisioning process requires that Microsoft Azure DevOps be configured.

Tier-2 environment: Tier 2 environments includes a Standard Acceptance Testing (SAT) Or User acceptance testing (UAT). As subscription plan One Standard Acceptance Testing (UAT) instance is provided for the duration of the subscription. This instance is a non-production multi-box instance which  can be use for UAT, integration testing, and training. Customer can purchase additional sandbox/staging instances separately as an optional add-on. Provisioning for Tier-2 occurs During on-boarding with the Microsoft FastTrack team.

Production environment– One production instance is provided per tenant. The production multi-box instance includes disaster recovery and high availability. It will be provisioned when the implementation approaches the operate phase, after the required activities in the LCS methodology and a successful go-live assessment are completed. There is no option to buy another environment this category. Provisioning for production environments occurs at the time of production system readiness phase. A production deployment request must be submitted in LCS. Deployment is done through the Dynamics Service Engineering (DSE) team within two business days.

Additionally, the following file storage and database storage are included:

File storage - Every customer receives 100 GB of file/Azure blob cloud storage for files and binary data. Additional file/blob storage can be purchased.

Database storage - Every Finance and Operations apps subscription includes 10 GB of Azure SQL Database storage per customer at no additional charge. Additional storage capacity is provided at no charge as an organization increases the number of user and device service licenses.

Difference between Tier-1 vs. Tier-2 and higher

Tier-1
Tier-2 and higher
Single-box environment
Multi-box environment
All components are installed on the same server, a Virtual Machine. These components include Application Object Server (AOS), the database, Dynamics 365 Retail, and Management Reporter. These components include Application Object Server (AOS), the database, Dynamics 365 Retail, and Management Reporter.
Components are installed on multiple cloud services, and typically include more than one Application Object Server (AOS).
Microsoft SQL Server is used.
Azure SQL Database is used.
The architecture differs from the architecture of the production environment to maximize efficiency and cost of the development team.
The architecture is the same as the architecture of the production environment, even though this type of environment has a different sizing and isn't enabled for disaster recovery.
The environment can be deployed in various ways. For example, it can be deployed as an add-on, it can be cloud-hosted, or it can be deployed as an environment image (VHD).
The environment can be deployed only as a standard environment or an add-on environment. It can't be cloud-hosted.
The environment isn't suitable for UAT or performance testing.
The environment is suitable for UAT and performance testing.

Happy DAXing....😊

Wednesday, March 07, 2018

Microsoft Dynamics 365 for Finance and Operations on the cloud Why????


Dear Friends,

Cloud based instances of Dynamics 365 are hosted on Azure (Microsoft’s web services platform) rather than on the user's own servers, and are accessed through a web browser. Microsoft is primarily responsible for maintaining the software infrastructure, including handling security measures, issuing updates, and performing data backups

PROS
  • No infrastructure to maintain
  • Access to Business intelligence and machine learning
  • High availability and disaster recovery
  • Data backups
  • Tight integration with other cloud products
  • Access to add-ons through AppSource
  • Fast implementation
  • Scalability
  • Always up to date
  • Futureproof


CONS
  • Internet-reliant
  • Data regulation restrictions
  • Storage costs
Happy DAXing....😊






Friday, January 19, 2018

Dynamics 365 FO on-premises deployments - Features does not implemented

Dear Friends

Microsoft offers on-premises deployment for Dynamics 365 FO. Many of us want to know what options we will not get while on-premises deployment. So here are the following features which have not been implemented in on-premises deployments as of now. These features have not been deprecated. If these features are critical to your on-premises deployment,Microsoft might added them in future release.

  • Task recorder
  • Support pane
  • PowerBI.com integration
  • Microsoft Office integration
  • Electronic reporting (ER) integration with LCS
  • ER integration with SharePoint
  • Author Power BI reports using OData
  • Retail
  • Purchase requisitions: Punch-out from external catalogs
  • SSRS scale out
  • Telemetry
Happy DAXing....😊

Saturday, November 11, 2017

Dynamics 365: MACRO OR CONST?

Macros still are supported on Dynamics 365 but now with the VS we can and should use “const” (Constants).
#define.MyMacro("Pankaj");
const str MyConstValue = "Pankaj-Constant";
info(strFmt("%1 - %2",#MyMacro, MyConstValue ));

If you want to use “const” in the same way that we were using before with a Macro file then you should replace the for a “static class”. See the example below:
static class MyConstClass()
{
   static const public str MyConstValue = "Pankaj-Constant";
}

Using the constant class:
str a = MyConstClass::MyConstValue;

It is advisable to use “const” instead of “macro”, and they are number of benefits:
  • ·         IntelliSense in the editor.
  • ·         Support for “Go to definition” in the editor.
  • ·         Full control of the type for the constant.
  • ·         Faster compilation – macros are notorious hard for the compiler to handle.
  • ·         None of the macro idiosyncrasies – like the ability to redefine/override.
Happy DAXing....😊

Monday, November 09, 2015

Limitations Of OData Service in AX 2012

Dear Friends

Those who are familiar with OData may notice that the OData query service has a few limitations. It's important to know these and not make assumptions so that you don't run into any surprises. The limitations are as follows:

• No JSON support: The OData protocol supports Atom as well as JSON, but Microsoft Dynamics AX 2012 only supports Atom.

• No create, update, or delete: With OData, you can also modify data instead of only reading it, but this feature is not supported in Microsoft Dynamics AX 2012.

• No support for query options: OData supports query options that allow you to, for example, select only the top five records, select only a specific entry, or sort the feed; however, this feature is not supported in Microsoft Dynamics AX 2012 and using it will result in an error.

• No support for queries with fetch mode 1:n: Using a query that has a data source which has its fetch mode set to 1:n will result in an error in the event log for the Feature Pack release and a warning for the R2 release. The latter will automatically convert the 1:n fetch mode to 1:1, which is the only fetch
mode that is supported.

• No support for views: Queries that use views are not supported, and using a view will result in an error.

Happy DAXing.... :)

Tuesday, September 08, 2015

How to implement basic authentication with AIF services in Dynamics AX 2012

Disclaimer:  This sample is not a production ready solution.  As described below the user credentials will be passed in plain text which is not ideal in a production environment.  To prevent this from occurring it would be recommended to incorporate SSL with this solution.

1.     Create inbound HTTP port.
a.     Navigate to System administration->Setup->Services and Application Integration Framework->Inbound ports.
b.     Create an inbound port using the HTTP adapter with settings similar to the image below.
Basic settings:


Service operations:

1.     Activate the new inbound port.
2.     We need to configure the client configuration.  In order to do this you need to select the ‘Configure’ button. Note:  Do not select the ‘Configure AOS’ button.
3.     You should see a dialog with a warning.  Just click yes to continue loading the configuration file.
4.     Locate the Bindings section under the Configuration frame and select ‘New Binding Configuration’ from the Bindings frame.
5.     Select ‘basicHttpBinding’ and click OK.
6.     In the ‘Name’ field enter ‘basicHttpBindingWithBasicAuth’.


1.     Click the ‘Security’ tab and set the attributes as shown below.


1.     Locate the ‘reqReplyEndpoint’ in the Configuration frame, and highlight it.
2.     Change the BindingConfiguration attribute for the endpoint from ‘basicHttpBindingWithWindowsAuth’ to ‘basicHttpBindingWithBasicAuth’.



1.     Save the configuration file and close the WCF configuration editor.
2.     Activate the SalesOrderHTTPService port.
3.     Open IIS manager and navigate to the MicrosoftDynamicsAXAif60 virtual directory.  Highlight it, and from the main frame open ‘Authentication’ from the IIS group.
4.     Enable Basic Authentication.  Your settings should look like that below.


1.     Close IIS manager and complete an iisreset from a command prompt.
2.     Open Visual Studio.
3.     Select File->New->Project.  From the New Project dialog select Windows Forms Application.  Enter a name for the project (e.g. SalesOrderTest).  Click OK.


1.     Once the project opens drag a button from the toolbox onto the form.


1.     Add the Sales Order Service reference to the project.  Note:  You can pull the address from the ‘Inbound ports’ form within Dynamics Ax. 
Important:  You will be asked for credentials in order to access the service and metadata.  I entered my administrator account and password until the RoutingService showed in the Services frame below, then cancelled all remaining authentication dialogs.  This will only work if you have Windows and Basic authentication enabled on your IIS box for the AIF virtual directory.



1.     Close IIS manager.  Open a command prompt and complete an iisreset.
2.     Open Visual Studio and open your project back up.
3.     Double-click the Button on the form to open the code window and create a new button_click event.
4.     Add a ‘using’ statement for the sales order web service. 

1.     Within the newly created button click event paste the following code.
            SalesOrderServiceClient proxy = new SalesOrderServiceClient();
            proxy.ChannelFactory.Credentials.UserName.UserName = @"domain\user";
            proxy.ChannelFactory.Credentials.UserName.Password = @"password";

            CallContext context = new CallContext();
            context.Company = "ceu";

            AxdSalesOrder salesOrder = new AxdSalesOrder();
            AxdEntity_SalesTable[] salesTables = new AxdEntity_SalesTable[1];
            AxdEntity_SalesTable salesTable = new AxdEntity_SalesTable();
  
            salesTable.CurrencyCode = "USD";
            salesTable.CustAccount = "1103";
            salesTable.ReceiptDateRequested = Convert.ToDateTime("2/1/2012");
            salesTable.Payment = "N060";
            salesTable.PurchOrderFormNum = "PO113";


            #region Financial Dimensions
  
            AxdType_DimensionAttributeValue dimBusinessUnit = new AxdType_DimensionAttributeValue();
            dimBusinessUnit.Name = "BusinessUnit";
            dimBusinessUnit.Value = "20";


            AxdType_DimensionAttributeValue dimCustomerGroup = new AxdType_DimensionAttributeValue();
            dimCustomerGroup.Name = "CustomerGroup";
            dimCustomerGroup.Value = "10";


            AxdType_DimensionAttributeValue dimDepartment = new AxdType_DimensionAttributeValue();
            dimDepartment.Name = "Department";
            dimDepartment.Value = "500";
  
            AxdType_DimensionAttributeValueSet valueSet = new AxdType_DimensionAttributeValueSet();
             valueSet.Values = new AxdType_DimensionAttributeValue[3] { dimBusinessUnit, dimCustomerGroup, dimDepartment };
            salesTable.DefaultDimension = valueSet;
             #endregion
  
            AxdEntity_SalesLine salesLine = new AxdEntity_SalesLine();
             salesLine.ItemId = "1000";
            salesLine.SalesQty = 1;
            salesLine.SalesUnit = "ea";


            AxdEntity_SalesLine salesLine2 = new AxdEntity_SalesLine();
             salesLine2.ItemId = "1000";
            salesLine2.SalesQty = 55;
            salesLine2.SalesUnit = "ea";

             AxdEntity_SalesLine salesLine3 = new AxdEntity_SalesLine();
            salesLine3.ItemId = "10004";
            salesLine3.SalesQty = 21;
            salesLine3.SalesUnit = "Pcs";
  
            AxdEntity_InventDim inventDim = new AxdEntity_InventDim();
            inventDim.InventSiteId = "1";
            salesLine3.InventDim = new AxdEntity_InventDim[1] { inventDim };

             salesTable.SalesLine = new AxdEntity_SalesLine[3] { salesLine, salesLine2, salesLine3 };
            salesOrder.SalesTable = new AxdEntity_SalesTable[1] { salesTable };

             try
            {
                 proxy.create(context, salesOrder);
                MessageBox.Show("Worked");
            }
  
            catch (Exception ex)
            {
                 throw ex;
            }

1.     Open IIS manager and navigate to the MicrosoftDynamicsAXAif60 virtual directory.  Highlight it, and from the main frame open ‘Authentication’ from the IIS group.
2.     Disable Windows Authentication.  Your settings should look like that below.


1.     Close IIS manager and complete an iisreset from a command prompt.
2.     Build and test the program.
Note:  The data presented in the sample above may not coincide with your existing database.  You may have to update the code to validate against your AX setup.  If you do not update the sample code you are likely to get a validation error returned from the server.

Happy DAXing.. :)

Source : MSDN Blog

Delete caches in Dynamics 365 F&O

In Dynamics 365 Finance and Operations (D365 F&O), clearing the Application Object Tree (AOT) cache usually involves running specific ut...