Total Pageviews

Friday, March 28, 2025

How to Import D365FO Packages Using Postman and the Data Management Package REST API -- X++ --D365FO Packages import

 


Introduction:

In this blog, we'll walk through the process of importing a D365FO package using Postman. We will focus on how to use the Data Management Package REST API, providing the necessary steps to configure and send your requests. Additionally, we will explain how to access container files stored in Azure Blob Storage using Postman.

1. D365FO Package Import Using Postman

To import a package in Dynamics 365 for Finance and Operations (D365FO), we utilize the Data Management Package REST API. Here's how you can do it:

API Endpoint

The endpoint to use for importing a package is:

https://BALI.Dynamics.com/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.ImportFromPackage

For more details on using the Data Management API, check out the official

2. Authorization

Before you can interact with the API, you'll need to authenticate your requests. The authentication is done via a Bearer Token.

Authorization Header

  • Key: Authorization

  • Value: Bearer <YourToken>

You can obtain the token by registering your app in Azure Active Directory and using the OAuth 2.0 flow to retrieve the token.


3. HTTP Request Headers

You need to set the following headers for your HTTP request:

  • Content-Type: application/json

4. Body of the Request

In the body of your request, you need to provide the necessary details in JSON format. Here is an example:

 {

  "packageUrl": "https://BALIBlob.blob.core.windows.net/saleslines/%74297-B72F-814249C6D103%7D%20",

  "definitionGroupId": "imp salesline",

  "execute": true,

  "overwrite": true,

  "legalEntityId": "BALI"

}

 

 

Parameters Explained:

packageUrl: The URL of the package file stored in your Azure Blob Storage. This is the URL where your package file is located.
definitionGroupId: The ID of the Data Management Definition Group you are importing.
execute: A boolean flag indicating whether to execute the import after uploading.
overwrite: A boolean flag indicating whether to overwrite existing data during the import.

    • legalEntityId: The ID of the legal entity associated with the data import 


5. Accessing the Package URL from Azure Blob Storage

The Package URL refers to the location of the package file that is stored in Azure Blob Storage. Here’s how to retrieve it:

  1. Log in to Azure Portal.

  2. Navigate to your Storage Account: Go to the Azure Storage account where your package file is stored.

  3. Select your Blob Storage: Choose the "Blob Service" and navigate to the container where the package is stored.

  4. Access the Container: Click on your container, and you’ll see a list of files.

  5. Select the Package File: Click on the package file you want to import.

its this is D365FO datapackage (exported from d365FO do needfull changes in data package and upload it to container) 







once we have container file URL we can access this from Post man


Conclusion

By following the steps outlined above, you can easily import data packages into Dynamics 365 for Finance and Operations using Postman and the Data Management Package REST API. With the flexibility of Azure Blob Storage for storing your files, this process streamlines data management in D365FO.

For more detailed guidance on using the Data Management API in D365FO, visit the official Microsoft documentation.









Friday, March 21, 2025

Preventing Price Recalculation for Imported Sales Lines ( custom price other then trade agreements price) in D365FO - X++ - Microsoft Dynamics 365 Finance & operations

 In D365FO if sales line is imported from excel using custom built solution or sales line is created from Code X++ and user provide its own unit price (price other then trade agreements) after sales line creation user go to sales order and click Recalculate and update the Unit price as per trade agreement. To stop this behavior (stop recalculation) if price is enter manually or is custom price is imported for sales line

need to add below code after you modify price in code 


Salesline.setPriceDiscChangePolicy(PriceDiscSystemSource::ManualEntry, fieldNum(Salesline, SalesPrice));

it will stop recalculating price for particuallar sales line when some one click Recalculate button on sales order 

D365FO and Sharepoint integration issue on dev box: "You are not authorized to connect to 'https://sharepoint.sharepoint.com/

Troubleshooting SharePoint Integration After Upgrading D365FO to Version .42 After upgrading to Dynamics 365 Finance and Operations (D365FO)...