Posts

Azure functions to interact with D365FnO using bearer tokens

Image
This article talks about performing CRUD operations, using trigger based Azure Functions, that can generate tokens and further posts the payload to D365FnO for processing. Broadly, for ease of understanding, I have split up the entire design into  a. Token generation logic: we are going to generate a short lived bearer-token, and pass it on to FnO for further executions.  b. Storing/retrieving Azure App based parameters: this is most tricky part of the solution. Typically, all developers have a habit of storing environment variables at configuration level. But unfortunately, we cannot take the configuration to server, during the deployment. We can see what all the choices could we have here.    c. Posting the payload to D365FnO for furtherance.  Additionally (not shown here), you can include logic to validate the incoming data of various fields' data given, to take necessary action, before committing to D365FnO. So, buckle your seatbelt Dorothy, 'cause Kansas is...

Using bearer token to call recurring integration of D365FnO using logic apps

Image
This article talks about using bearer token to authenticate recurring integration URIs to talk to D365FnO. For our example, we are using an XML based input, which we need to feed into D365FnO (for example: you can think of a feeding an XML to a composite entity). Assuming that we already have an enqueuing URL in place, we can go to logic apps designer to declare a variable called 'token' for our ease of calculations: We can call the token generating URL, through a HTTP POST request connecter in our Logic apps, as follows: Here the URI implies: the token generator URI, from " https://login.microsoftonline.com "  Header: set 'Content-type' as 'application/x-www-form-urlencoded' In Queries set: 'Grant_Type' = 'client_credentials' And in the body, set Client_Id = <Client Id from your App registration>, add your client_Secret by appending '&'. Client_Secret = <from your app registration>, add grant_type= 'Client_c...

Parsing/reading CSV and excel file from Azure Blob storages, using Logic Ap for D365FnO

Image
  This small write-up can help you to read from a CSV or Excel and populate records in D365FnO, using Logic Apps. The main challenge here is, reading from Azure Blobs is easy, but the content thus obtained is a jumbled up JSON content and certainly not a CSV content. This document gives you an idea as to how to transform for the same, so that you can invoke a FinOps entity and do the rest of the CRUD operations. We are reading here a simple CSV file that contains of two columns, and we need to insert into SalesPool table: a. Reading from Blob: Supposing we have a scheduler that reads from an Azure blob, by looping through all the newly added blobs in a container (here the container name, for example, is ' container1 '): And then getting the content of the file using the following loop: We need to get the name of the file (the newly added file name in the blob container). This we can find out, first by inspecting the output from the previous step: {    "Id" :  "JT...

Using transforms in Dual-Write

Image
Dual writes do have a built-in capability of translating unlike data types to talk to one another. You have a Base enum on FinOps end, which is talking to an PickList type field on a CRM table. Normally if you map this, while saving itself, you will get an error: In order to solve this problem, while adding the map you can click on the '=' sign , select Transform type as 'Value map'. This will let you store the enum value specific defaults as key-value pairs: Now you can keep adding the key value pair of the translation of the mapping to make the system understand which enum value corresponds to what integer value: Save this, come back to mapping screen and save the map. It will now let you save without any issue this time. 

Confused and irritated with the error: "Exception: Cannot create a record in Alerts - event inbox data (EventInboxData)"? There is an easy hack.

I guess many of us have faced the issue of the below workflow error, while processing D365 FinOps Workflows: " Stopped (error): X++ Exception: Cannot create a record in Alerts - event inbox data (EventInboxData). Inbox ID: 5637144724 " For this you need to clear the dirty data, as outlined in the process below: select   *   from  EVENTINBOXDATA  where   not   exists   ( select   top  1  *   from  EVENTINBOX  where  EVENTINBOX . INBOXID  =  EVENTINBOXDATA . INBOXID ) Suggestion : backup EVENTINBOXDATA or backup database run below script to clean up the junk data : delete   from  EVENTINBOXDATA  where   not   exists   ( select   top  1  *   from  EVENTINBOX  where  EVENTINBOX . INBOXID  =  EVENTINBOXDATA . INBOXID )  

Using Azure API integration with D365FO - Part I

Image
  Azure API: quick overview Azure APIs are a stub of reliable connecters to any external world that can let you connect your application to talk to any 3 rd party appliance. Azure API in itself is a huge sea of possibilities: a.        letting you parse a web request using its rich NEWTON-SOFT based policies b.       letting you further call a function app c.        letting you further call a logic app d.       letting you further call another OpenApi/SOAP based web service The most appreciative features of Azure API are: a.        high availability: owing to being the integral part of MS Azure offering, Azure APIs can offer you an undisrupted service b.       flexible payment options like I.                   ...