Total Pageviews

Thursday, April 3, 2025

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) version .42, we encountered an issue with all of our SharePoint integrations. Here's a step-by-step guide on how we identified and addressed the problem.

Verifying the D365FO and SharePoint Connection

To verify the connection between D365FO and SharePoint, we navigated to the Document Management Parameters section. From there, we selected SharePoint and clicked on Test Interactive Connection to check the connectivity status.

Unfortunately, we received the following error message:
"You are not authorized to connect to 'https://sharepoint.sharepoint.com/'."

This error prompted us to open a support ticket with Microsoft to further investigate the issue.

Microsoft’s Response and Solution

Microsoft's response highlighted an important distinction regarding development environments. They clarified that:

"For development purposes, a Unified Development Environment (UDE) will work. However, this will not work in a regular cloud-hosted environment. So, if there is a need for active development with SharePoint, a UDE is the recommended approach."

What is a Unified Development Environment (UDE)?

A Unified Development Environment (UDE) is a specialized development environment designed for working with Finance and Operations apps, such as Dynamics 365. It allows seamless integration with SharePoint for active development and testing. However, it's important to note that the standard cloud-hosted environment does not support the same level of integration for development purposes.

Conclusion

If you are facing similar issues with SharePoint integration after upgrading D365FO, it may be due to the environment you are working in. For active SharePoint development, consider switching to a Unified Development Environment to ensure smooth connectivity and integration. If you’re using a cloud-hosted environment, you may encounter limitations as we did.

For more information on using UDE and troubleshooting D365FO integration, visit Microsoft’s official documentation on Unified Developer Experience for Finance and Operations Apps.

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