Sunday, September 8, 2024

Token Generation in On-Premises vs. Cloud D365 Finance and Operations with .NET Adapter

Today, I want to shed light on a common challenge we may encounter when generating tokens in .NET adapters for integrating Dynamics 365 Finance and Operations with third-party applications. 

In the code snippet below, the HttpRequestMessage class is used to pass essential client credentials for the app registered in the Azure portal. This approach works seamlessly in a cloud environment.

Token generation in .NET adapter using HttpRequestMessage

There are numerous blog posts available on registering an app, and I'll provide a helpful link for your reference here from Microsoft Learn Register an application with the Microsoft identity platform.

Unfortunately, the earlier approach doesn’t work for on-premises instances of Dynamics 365 Finance and Operations. After experimenting with several methods, I found an alternative solution. As shown below, I used a PowerShell script to generate the token.


PowerShell script to generate token

In my .NET adapter class, I then used the PowerShell script to retrieve the token, as demonstrated in the code snippet below.


I hope this post helps save you significant time and effort if you're facing a similar issue. I’d love to hear your feedback as well!
         


Tuesday, January 17, 2023

Fix: Issue in publishing changes in excel template

It was required to add custom financial dimension such as OFFICE, COSTCENTER in FINOPS D365 to excel add-in in D365. I used standard documentation for this type of customization that has already been provided by the Microsoft as following. Using that, custom financial dimensions were added and this worked quite well for us!

https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/financial/dimensions-overview

https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/financial/add-dimensions-excel-templates

Issue:

However, we started facing following issues while publishing dimensions using excel after renaming financial dimensions like A_Office, B_CostCenter etc.

A row update in data set LedgerJournalLines was not published. Error message: 'The dimension display value could not be generated. Internal error: Exception occurred while executing action getCombinationDisplayValue on Entity DimensionCombination: Error found when validating record.'

Resolution:

Configuration change:

There was a missing setup in "Financial dimension configuration for integrating applications", Previously it had only defined for type Default dimension format, but you need to also have definition for type: "Ledger dimension format"

Technical resolution:

All the dimensions which were added previously from back-end with names Office, CostCenter etc. should be removed and added again with names A_Office, B_CostCenter etc.


References:

https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/296783/unable-to-publish-changes-excel-import


Wednesday, January 26, 2022

Modify expiry and delivery date in RFQ created via Purchase requisition : D365 Finance and Operations

The feature of processing requests for quotations in Dynamics 365 Finance and Operations enables visibility to the quoting process, traceability, and better collaboration among buyers and suppliers(vendors) but it becomes complex for certain new users. 

It is recommended to go through this blog which is also a sort of a training guide for new users. 

Today I would like to share with you a business requirement along with the solution while creating a request for quotation via purchase requisition.

Create the request for quotation from purchase requisition.

While creating a purchase requisition, it is mandatory to setup the workflow "Purchase requisition review"

Navigate to Procurement and sourcing -> Procurement and sourcing workflows.

You can have an overview of the workflow here in this blog. Workflows can be configured on both purchase requisition header and lines. Once the purchase requisition workflow is configured now it is time to create a purchase requisition and submit to workflow. 

Navigate to Procurement and sourcing -> All purchase requisition


Click the "New" Button and add required purchase requisition lines and initiate the workflow process by clicking submit. 

Now you will be able to see "Create request for quotation" button enabled to create the RFQ from purchase requisition. Click this button and now you can see the request for quotation created from purchase requisition.

Navigate to Procurement and sourcing -> Request for Quotations -> All request for quotations

Business Requirement:

Now as per the business requirement, it was required to add the days offset in expiration and delivery dates of request for quotation so that while creating request for quotations from purchase requisition, the days offset is added automatically.

Solution: 

In order to meet the first requirement of adding the offset in expiration date, you can do in "Procurement and sourcing parameters" by adding the days offset.

Navigate to Procurement and sourcing -> Setup -> Procurement and sourcing parameters

And once you define the days offset in above screen, the expiration date is found added with days offset.

However, it is required to do a little bit of coding to modify the delivery date. 
Create an extension class of "PurchRFQCaseAutoCreate_PurchReq" and override the method "setPurchRFQCaseTable"


 I hope this blog post will help you understand the process of creating request for quotation via purchase requisition. Please keep following my blogs. I appreciate your feedback and comments. Thank you!