June 09, 2025

QuickFix: Unable to do PITR from Prod to sandbox

If you are getting below error while trying to do a PITR from Production to one of your Sandbox environment, and getting below or similar error message


Error message:

Sorry, unable to start this operation. Please try again or contact support if the issue persists.
Session ID 3820sdfgsdff-a2c9-4345dsfgc-96e4-f1easdfg3d28sdf712
Search timestamp 2025-06-09T21:03:07.468Z
23.011.115.942-b25fa8ee-stable at ProdDemoTest


Possible Reason: 

You are trying to restore very recent backup which might be still in progess, for example, you at 10:05 AM , you are trying to restore a Production backup of 10:00 AM. 


Solution: 

Try to choose at least two hours earlier time to do PITR. 


-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

June 04, 2025

Configuring MT940 Bank Reconciliation in D365FO Using Electronic Reporting

Introduction

In any organization the bank reconciliation is a critical process in financial operations, ensuring that your internal records match your bank's statements. In the latest version Microsoft Dynamics 365 Finance and Operations (D365FO), the Advanced Bank Reconciliation can be done via Elecroic reporting (ER), this feature allows you to automate this process using formats like MT940, BAI2, and ISO20022. This post I will walk you through setting up MT940 reconciliation using Electronic Reporting (ER).
Before we begin, please make sure you have System Administrator or Electronic Reporting Developer Role.
Let’s start configuration now, 

Import MT940 ER Configuration

1. Navigate to Workspaces > Electronic Reporting.
2. Click on Configuration Providers and select Microsoft.
3. Open the Global repository (or Dataverse if configured).
4. Search for and import the following configurations (Always import the latest version of each configuration)
   - Advanced bank reconciliation model
   - MT940 format mapping
   - MT940 format (TXT)

Set Up Bank Statement Format

1. Go to Cash and Bank Management > Setup > Advanced bank reconciliation setup > Bank statement format.
2. Click New and fill in:
   - Statement format: MT940
   - Name: MT940 Format
   - Generic electronic import format:  Checked
   - Import format configuration: Select the imported MT940 ER format

Configure Bank Account for Reconciliation

1. Navigate to Cash and Bank Management > Bank accounts.
2. Select the bank account you want to configure.
3. Under the Reconciliation tab:
   - Set Advanced bank reconciliation to Yes (You cannot undo this step, so choose the right record)
   - Choose the Statement format as MT940

Test the Import Process
1. Go to Cash and Bank Management > Bank statement reconciliation > Bank statements.
2. Click Import statement.
3. In the dialog:
   - Select the Bank account
   - Choose Statement format: MT940
   - Upload your MT940 sample file
   - Click OK

If configured correctly, the transactions will be imported and ready for reconciliation.

Troubleshooting Tips
- Transformation Errors: Ensure the MT940 file matches the expected structure. You can validate using the ER designer.
- No Transactions Imported: Check if the bank account number in the file matches the one in D365FO.
- Post-DB Refresh: Re-import ER configurations and re-link them in the import project.

May 29, 2025

Top 5 New Features in Dynamics 365FO

Microsoft’s 2025 Release Wave 1 for Dynamics 365 Finance and Operations brings a fresh wave of innovation, with AI, automation, and smarter data handling at its core. In this post I will share my thoughts on top 5 feature which I think will make huge difference in your day-to-day operations in near future.

1. Copilot-Powered Financial Task Assistance

What it does: Copilot now integrates directly into finance workspaces, allowing users to interact with financial data using natural language. It can generate reports, surface insights, and even guide users through complex processes. It  helps users resolve financial tasks directly within their workspace using natural language prompts.

Why it matters: Imagine reconciling accounts or generating reports just by asking Copilot. This reduces time spent navigating menus and boosts productivity for finance teams.

ü  Reduces reliance on IT or power users for data queries.

ü  Speeds up decision-making with instant access to insights.

ü  Minimizes training time for new users. 

Some Use case: 

ü  A finance manager can ask Copilot to “show unreconciled transactions for April” or “generate a cash flow forecast,” saving hours of manual work.

ü  A CFO types: “Show me overdue customer invoices over £10,000” — Copilot instantly returns a filtered list.

ü  An accountant asks: “What’s the variance in budget vs actuals for Q1?” — Copilot generates a visual report.

ü  A finance analyst says: “Create a journal entry for payroll accruals” — Copilot guides them through the process. 

2. Prepayment Sales Invoices

What it does: This feature allows businesses to issue and manage prepayment invoices as part of the sales order process. It supports partial or full prepayments and automatically applies them to final invoices. It enables businesses to create and manage prepayment invoices directly within the sales process.

Why it matters: This is a game-changer for industries where upfront payments are standard (e.g., manufacturing, construction). It ensures better cash flow and reduces manual tracking.

ü  Improves cash flow by collecting payments earlier.

ü  Reduces manual tracking of prepayments.

ü  Enhances customer transparency and compliance. 

Some Use case: A sales team can issue a prepayment invoice before shipping goods, and the system automatically applies it to the final invoice.

ü  A construction company requires 30% upfront before starting a project. The system generates a prepayment invoice and applies it to the final billing automatically.

ü  A manufacturing firm selling custom machinery can issue a 50% prepayment invoice upon order confirmation, ensuring financial commitment before production begins. 

3. Bank Foreign Currency Reconciliation Automation

What it does: This feature automates the reconciliation of foreign currency transactions by matching bank statement lines with ledger entries, even when exchange rates differ. Automates the reconciliation of foreign currency transactions in bank statements.

Why it matters: Manual reconciliation of multi-currency accounts is time-consuming and error-prone. Automation ensures accuracy and saves time.

ü  Saves hours of manual reconciliation work.

ü  Reduces errors in multi-currency environments.

ü  Improves audit readiness and financial accuracy.

Some use case: A global finance team can reconcile USD, EUR, and GBP transactions with minimal manual intervention, improving month-end closing speed.

ü  A global retailer with bank accounts in USD, EUR, and GBP can automatically reconcile daily transactions, even when exchange rates fluctuate.

ü  A finance team can close books faster by letting the system auto-match 90% of foreign currency entries, flagging only exceptions for review.

4. Create Dimensions and Cubes with Copilot

What it does: Users can now define financial dimensions and analytical cubes using natural language. Copilot helps configure these for use in reporting and Power BI dashboards.

Why it matters: This democratizes data modeling—no need for deep technical skills to build powerful analytics.

ü  Empowers business users to build analytics without technical help.

ü  Accelerates time-to-insight for decision-makers.

ü  Reduces dependency on IT or BI teams.

Some Use case: A business analyst can say, “Create a cube for sales by region and product line,” and Copilot builds it, ready for Power BI integration.

ü  A controller says: “Create a dimension for marketing spend by campaign and region” — Copilot sets it up and links it to the general ledger.

ü  A business analyst asks: “Build a cube showing sales, cost, and margin by product category” — Copilot generates the model, ready for Power BI.

5. Streamlined Integration with Business Performance Analytics

What it does:  This feature enhances the integration between D365FO and Business Performance Analytics (BPA), enabling real-time data refresh and seamless KPI tracking.

Why it matters: Real-time data refresh and seamless integration mean faster insights and better decision-making.

ü  Ensures executives always have access to the latest data.

ü  Reduces manual data exports and refresh cycles.

ü  Supports proactive decision-making with live dashboards.

Some use case: Executives can view up-to-date KPIs and forecasts in dashboards without waiting for manual data exports or refreshes.

ü  A CEO views a live dashboard showing revenue, gross margin, and customer churn — all updated in real time from D365FO.

ü  A finance team builds a rolling forecast model in BPA that pulls actuals from D365FO every hour, ensuring up-to-date planning.

Final Thoughts

[To try them out, head to the Feature Management workspace in D365FO and enable them in a test environment first.]

These features reflect Microsoft’s commitment to AI-first, user-centric design. Whether you're in finance, operations, or analytics, these tools are built to save time, reduce errors, and empower smarter decisions.

If you're considering enabling these features, check the Feature Management workspace in D365FO to toggle them on and explore their setup.

April 09, 2025

How to trigger Business event using x++ code

Hi Folks, 

I recently faced issue where PO confirmation business event was not triggering and failing my interface. Issue was whenever after first PO confirmation if user make change to PO header delivery date or cancellation date  and reconfirm the PO, it wont trigger the respective Business event. 

[Although there are different reason why business event is not considering this change, while if I make any financial changes like qty, line addition, tax etc, it works fine]

Ok lets see now how I can call a business event from code, 

To trigger a business event in X++ code, you need to create a business event contract, an event handler class, and then trigger the event from your X++ code by using the BusinessEvent::newFromTable() and businessEvent.send() methods. (Also,  configure the event in the business event catalog if its not configured)

1. Create a Business Event Contract:
Purpose: Defines the data that will be sent with the business event. For reference check  CustFreeTextInvoicePostedBusinessEventContract.


 2. Create an Event Handler Class:
Purpose: Handles the event when it's triggered, allowing you to perform actions based on the event.
For reference check CustTable_BusinessEvent_EventHandler

3. Trigger the Business Event from X++ Code:
Purpose: Use the BusinessEvent::newFromTable() and businessEvent.send() methods to trigger the event.


here is complete code sample, 





-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

March 17, 2025

Update admin user in Dev box

Old is gold,


MS removed admin user provising tool, but there is an old way where you can still add your user as admin, 

Go to the VM and open SQL management Studio, 

Step 1: Find admin user rec id in USERINFO table, 

select  * from USERINFO

Step 2: Get SID from earlier Database for your user

select  * from USERINFO
where RECID = 53755554576


Step 3: Update new Database with below query 

update USERINFO
set NETWORKALIAS = 'deepak.agarwal@theaxapta.com',
sid = 'S-1-19-18-####-####-####5192'
where RECID = 53755554576


Make sur eof choosing right Database of each query and use the right recid and other values. 


-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

January 24, 2025

Custom web service in D365FO - Part-I

Introduction

Custom services in Dynamics 365 Finance and Operations (D365FO) allow you to expose custom business logic and data to external systems. This first part of the blog post will walk you through the basics of creating and consuming custom services in D365FO. Custom services are used to expose X++ business logic to external systems via SOAP or RESTful endpoints. They are ideal for scenarios where you need to implement complex business processes that are not covered by standard services.

In later posts, we will discuss some complex scenarios and best practices around web services.

Architecture

Service Request Contract

The service contract defines the operations that the service will expose. This is done by creating a new class with the [DataContractAttribute] and [DataMemberAttribute] attributes. There must be two contract classes: one for the request message and another for the response message. (We will cover this in detail in future posts).

Example:

[DataContractAttribute]
public class TheAxaptaRequestContract
{
    private boolean isShipped;
    private String255 dataAreaId;
    private String255 storeNumber;
    private String255 trackingNumber1;

    [DataMember("TrackingNumber1")]
    public String255 parmTrackingNumber1(String255 _trackingNumber1 = trackingNumber1)
    {
        trackingNumber1 = _trackingNumber1;
        return trackingNumber1;
    }

    [DataMember("IsShipped")]
    public boolean parmIsShipped(boolean _isShipped = isShipped)
    {
        isShipped = _isShipped;
        return isShipped;
    }

    [DataMember("DataareaId")]
    public String255 parmdataAreaId(String255 _dataAreaId = dataAreaId)
    {
        dataAreaId = _dataAreaId;
        return dataAreaId;
    }

    [DataMember("StoreId")]
    public String255 parmStoreNumber(String255 _storeNumber = storeNumber)
    {
        storeNumber = _storeNumber;
        return storeNumber;
    }
}

Service Response Contract

Example:

[DataContractAttribute]
public class TheAxaptaResponseContract
{
    private boolean success;
    private str errorMessage;
    private str debugMessage;
    private System.String salesOrder;

    [DataMember("Message")]
    public str parmMessage(str _value = errorMessage)
    {
        if (!prmIsDefault(_value))
        {
            errorMessage = _value;
        }

        return errorMessage;
    }

    [DataMember("Success")]
    public Boolean parmSuccess(Boolean _value = success)
    {
        if (!prmIsDefault(_value))
        {
            success = _value;
        }

        return success;
    }

    [DataMember("DebugMessage")]
    public str parmDebugMessage(str _value = debugMessage)
    {
        if (!prmIsDefault(_value))
        {
            debugMessage = _value;
        }

        return debugMessage;
    }
}

Service Class

This is the class where the actual business operation executes. It takes the request message from the respective contract class and processes it to create a response message. Create a new class to implement the service. This class should extend the SysOperationServiceBase class and include the business logic for the service operations.

Example:

public class TheAxaptaService extends SysOperationServiceBase
{
    TheAxaptaResponseContract response = new TheAxaptaResponseContract ();
[AifCollectionType('salesOrder', Types::Class, classStr(TheAxaptaRequestContract)),
AifCollectionType('return', Types::Class, classStr(TheAxaptaResponseContract ))]
public processMsg() { TheAxaptaRequestContract request;
// Now you can access the parm methods of the request class to get different values from the request Str StoreId = request.paramStoreNumber(); response.parmSuccess(True); response.parmMessage("Message read"); } }

Register the Service

Register the service in the AOT (Application Object Tree) by creating a new service node. Set the class and method properties to point to your service implementation.

  1. In the AOT, right-click Services and select New Service. (e.g. TheAxaptaInterface)
  2. Set the Class property to your service class (e.g., TheAxaptaService).
  3. Set the Method property to the service method (e.g., processMsg).

Deploy the Service

Deploy the service to make it available for consumption. This can be done by right-clicking the service node in the AOT and selecting Deploy Service Group.

Consume the Service

A third part can consume this service using the below syntax

<EnvironmentURL>/API/services/TheAxaptaInterface/TheAxaptaService/processMsg

and send the request message in body.

If you want to setup postman to test your services by yourself, I would recommend to checkout this blog post, Best way to do Postman setup with D365FO.


Here is complete code uploaded on Git Repository