Dynamics 365 Tag - Page 13 of 16 - - Page 13

Tag Archives: Dynamics 365

Integrate Teams with Dynamics 365 for Custom Entities

In this blog, we will see how to integrate Microsoft Teams with Dynamics 365 for custom entities using Postman. Step 1- Go to portal.azure.com and select Azure Active Directory Step 2- On App Registration, click on new registration  Step 3- Register an application and follow the steps  Name  Select Multitenant  Enter the required URL  Click on register  Step 4- Add API permissions and add a permission. The request API permission window will appear where you need to select Dynamics 365.  Step 5- The permission window appears and select Dynamics 365. Step 6- As you select Dynamics CRM you will be presented the permission window. Select “Delegated permission” and Check the User Impersonation then click Add Permission button.  Step 7- After permissions assigned, Grant admin consent confirmation: Click on yes. Step 8- Go to Manifest and change “allowPublicClient”: true  Step 9- Go to Overview, save client ID  Below table will help out to fill in the values in Postman: Variable Name URL url Dynamics URL Version 9.0 Webapiurl {{url}}/api/data/v{{version}}/ Clientid Client ID (Showed in above screenshot) callbackurl http://localhost authurl https://login.microsoftonline.com/common/oauth2/authorize?resource={{URL}} Step 10- Go to Postman, create a new environment and enter all the details in the table: Step 11- Now connect to the environment from top right most corner Step 12- Then create a new request Step 13- Include the following in body: Put status as: Enable: true and Logical Entity Name: Schema name of the entity. Step 14- Go to Authorization tab. From the Dropdown Select OAuth 2.0. Now we will provide the variable values to generate token. Give a name of token Choose Grant Type Implicit and provide corresponding variables for Callback URL, Authorization URL and Client ID. Then click Get new Access Token. Step 15- Now click on Get New Access Token Step 16 – It will prompt you to login Dynamics 365 after you provide your authentication the token will generate. Step 17- Now click on Use Token Step 18- Click on Send button Step 19- Now, collaborate button will be visible in ribbon for required custom entity Hope this helps!!

Send Records from Microsoft Dynamics 365 through email using Azure Logic Apps.

In this blog we will copy a list of Account names that exists on our Microsoft Dynamics 365 system and send all these names via email using Azure logic Apps. To start the map select a HTTP request trigger, which would run on demand at the click of the run trigger button. After defining the trigger and an action to list rows from Dynamics 365 and select the entity needed from the drop down. In this case I have selected Accounts. You can also add filters using parameters to limit the data extracted. Initialize a variable in order to store the data, since there are more than one records the data type of the variable should be an array Now for each record (value) found in Dynamics 365 we have to add it to the array, therefore we use a For each loop and append new data to array inside the for loop Next we will use a Send Email block and add the variable which we used to store account names. After this we can run the flow On running the map an email containing all account names in our Dynamics 365 system gets received. Hope this blog helped!!

[Quick Tip] Get SubGrid View Id using Primary Control or Selected Control for Ribbon button’s enable rule in Dynamics 365 CRM.

Use case: I have two entity Awards and Awards category. We have SubGrid on the Awards entity form for Category with Custom Ribbon button. We want to have the button should be visible on specific view only and below are steps to do so. Step 1: Configure the Ribbon Button Create a Ribbon Button, create a command and enable rule. Added enable to Command and command to ribbon button. To enable rule, create a custom rule and pass the JavaScript and parameter. Step 2: Get View id based on the CRM parameter: Now, Get Subgrid view id by passing the CRM parameter in the custom rule. When CRM parameter is Primary Control When CRM parameter is Selected Control Step 3: Write script for Enable Rule for Custom Ribbon Button. We will write a script that will enable or disable the Ribbon based on the view ID using the above code based on the passed parameter. Result: I have written the enable rule that Button should be visible only on the Active Award Category view: Result View of Current View that we get from the Controls in Web Browser Console App Full Code:

Let’s get started with Azure Function for Dynamics 365 CRM: Part 2 [Cloud Deployment]

In the previous blog, we have learned how to create an azure function to connect with Dynamics 365 CRM and create an account record whenever an azure function is triggered by the HTTP request. [Link]. In this blog, we will learn how to deploy the Azure Function App to Azure Cloud so that we can trigger that function anywhere. Prerequisite 1. Microsoft Azure Account 2. Active Subscription [Create a Free trial or Pay-as-you-Go Subscription] If you are creating an azure function for learning purposes, then go with Free Trial but if you are working on the development for your organization or client then go for a Pay-as-you-Go subscription. Step 1: Create a resource on Azure Portal for Azure Function Deployment. Login to the portal.azure.com with your account and click on Create a resource: Create a resource for Function App as mentioned below screenshot: Here we will create a new resource group but If you don’t have any existing resources. Following are configuration details that you need to fill during the creation of the resource. Function Name: It is a global URL to access the Azure Function App and it must be unique. Publish: You can directly publish your code or use Docker Container for publishing your Azure function Runtime stack: Here we are building the .net application so we will choose .Net as our Runtime stack to support Azure Function. We have multiple options we can create an azure function for Nodejs, Python, Java, Powershell core or you can use customer handler. After configuration are you ready to click on “Review and Create” It will take a few minutes to create and deploy the Azure Function App in the cloud. Step 2: Publishing the Azure Function from Visual Studio: Open the Azure Function project in Visual studio. Right-click on the Project and click on the Azure. You will get the below screen on that we need to click on the Start. Now we will choose Azure as we are deploying the Azure Function on the Azure Cloud and click on Next: Once you select the azure then it will open the configuration screen. In the configuration window, you need to log in with Azure Account with Active Subscription. Select the resource group and select the function app as mentioned below screenshot. After the configuration is finished click on Publish. It will take a few minutes to deploy the application to the cloud. Step 3: Get Azure Function URL from Azure Portal. Open newly create Function App in the Azure portal app and click on the Function App: You will find the function1 has been deployed. Click on that function to open it. To Get the Function URL click on the Get Function URL and copy the URL. Testing We will require the API testing tool, here I am using Postman and the following is the link to download “Postman”. https://www.postman.com/downloads/ Open the Postman and click on the create a new tab. Select request as POST and paste the URL: After pasting the URL, click on Send: Now, we will take look at Dynamics 365 CRM environment and check whether the account is created or not. Before After: Stay Tuned for the next Blog. In the next blog, we will create a Contact Us form in HTML and post data using Azure Function Dynamics 365 CRM to store the responses from your website. External Links: Azure Function Pricing: https://azure.microsoft.com/en-in/pricing/details/functions/

Let’s get started with Azure Function for Dynamics 365 CRM: Part 1

In this blog, we will learn how to create an Azure Function App to connect it with Dynamics 365 CRM and perform the CRUD operation in Dynamics 365 CRM. First, we will create an Azure Function project for Dynamics 365 CRM from Visual Studio, and below are the steps for the same. Open Visual Studio and create a new Azure Function Project. Filter platform as Azure, select Azure Function, and click on Next. Name your project and click on Create button. After clicking on Create, you will get the below screen where you need to select the Trigger and Azure Function v1 (.Net Framework) and click on Create. In my case, the Azure Function trigger will be Http Trigger which means when an azure function will receive an HTTP request it will trigger. Your Azure Project will be created and the following will be the structure of the project. Now, we will create Azure Function to connect with the Dynamics 365 CRM we need to add the required NuGet Package [Microsoft.CrmSdk.CoreAssemblies]. To add the NuGet Package right-click on the Project and click on Manage Nuget packages. Add Microsoft.CrmSdk.CoreAssemblies in your Project. Following is the code to connect the Dynamics 365 CRM. Currently, we are going to use the credential by specifying them in the C# Code or you can use it as constant. Later in the series, we will learn how to use Environment Variable and pass the credential more secure way in Azure Function using Azure Key Vault. [Stay tuned..!!] Now, select the code and Refactor the code and make the connection function that will return the IOrganizationService if the connection is established else return null. Now, the final code will be as below: Now, we will create a customer with a Hardcoded name when the function is triggered with an HTTP request. Update the existing code with the below code: Testing: We will require the API testing tool, here I am using Postman and the following is the link to download “Postman”. https://www.postman.com/downloads/ To test the application, click on the Start button on top of Navbar as mentioned below in the screenshot [Button will have Project Name]. It will take a few minutes to Load the Azure Emulator Following is the screen you will be able to see and copy the URL highlighted in the red below and paste that URL in Postman. Open the Postman and click on the create a new tab; Select request as POST and paste the URL: After pasting the URL, click on Send You will get the following response on the Azure Function Tool and Postman If there any error or issue with the Azure Function code, the request will be failed and will be displayed on both Azure Function Tool and Postman [Status will be “4**” or “5**” ] Now, we will take look at Dynamics 365 CRM environment and check whether the account is created or not. We are justing getting started with Azure Function for Dynamics 365 CRM and stay tuned for more in this series. Upcoming blogs 1. How to use Dynamics 365 Credentials securely using Azures Function. 2. How to create Dynamics 365 integration with Third-party Applications. Many more……

Change Currency format in D365 Customer Engagement

In this blog we will see how we can change the currency format in D365 CE. We are using the Currency field named Price on Account form and we wanted to price in XX,XX,XXX.XX format Let see how we can achieve this. Solution: Go to Settings and click on Personalization settings. After clicking on Personalization setting, In Set Personal Options click on Format. Click on Customize -> in Number, Digit group change the format as per requirement. After updating click on Apply and Ok. In our requirement, we wanted currency in XX,XX,XXX.XX  format on Account Entity. Price field Before Changing – Price field after changing –

Track an Entity record form opening / retrieve activity by system user in Dynamics 365 CRM

If you want to track a user who has opened records of any specific entity then you are on the right blog because today we are going to see how we can do simple customization to track the user activity of who has open which record for how many times. Step 1: Create an Entity to track the log of retrieve activity of the registered entity. Following are fields in the entity to track user activity tracking activity 1. Name — Logical name of Retrieved Entity. 2. Record Id — Record Id of that Retrieved Entity. 3. No of Time Retrieved — Stored number of times a user has retrieved that specific record. Step 2: Create a Plugin to create a Retrieved Log record The record will be created or updated whenever the user opens the entity form to check details and the following is code for the same. Explanation: 1. When the plugin will trigger it will check if the retrieved log of that record is already present or not. 2. If retrieve records is not present it will simply create a log record with the following details a. Name — Type of records which user has opened [Entity] b. Record Id — Record Id of record which user has opened c. User — which the user has opened the record. d. Count = 1 3. If the retrieved record is already existing in the system then it will increment the count of the number of times a user has retrieved that record by 1 so that we can track how many times the same user has open that specific record. Step 3: Register the Plugin on Retrieve of Entity on entities for which you want to add tracking. Retrieve: It will trigger whenever an entity form is open by any user. While registering the new step for the plugin please make sure that Run in User’s Context must be “Calling User” so that we can have a track that which user has opened which record. Note: All security roles which are given to the user should have read, create and update right to “Entity Tracker” Entity. Also, the stage of execution of Plugin and execution mode must be “PostValidation” and “Asynchronous” so that it will not affect any system jobs and it can run in the background process. If you want to track a retrieve activity of opportunity then you just need to register the new step and select Primary Entity as an opportunity as I have already done for Account and Contact. Now, your system is ready to track the user’s entity retrieve activities, and you will see the following records: Using the above record you can create any type of custom charts and put them in your admin dashboard or you can create a Power BI report to track activity. I hope this helps you, if yes please like the blog. And, the next blog will be on the dashboard & charts based on our Entity Tracker records so stay tuned for that!

Autosave quick create a form record on fields change and open the created record

Requirement: The user will create the record from the Quick Create and on change of specific field, the record should automatically save. Whenever the record will be saved it should open the created record. In our scenario, we are going to use the Account Entity. When the user will enter the main phone data in the Account Quick Create Form, the record will automatically save and it will open the created account record. Steps: Go to Default Solution or your customization solution and Open the Quick Create Form from Account Entity 2. Click on the Form Properties to edit the form properties of Account Quick Create Form and add the script on the form. 3. Click on the +New button to add the JavasScript web resources on the form so that you can use the script function on Form Events 4. If you wanted to use an existing Web Resource then you add it or else create new by click on new 5. Create a new Script and add it on form 6. Now, we need to add the event list and bind the calling function to it. To do it click on the + New on Event Listener of Form Properties. Note: Please don’t forget to pass the execution context as the first parameter to the function. 7. We will use formContext.data.save() function to get the created record’s GUID and open entity record using that GUID. Following is code for your reference: 8. Code Explanation: a. quickCreateonSave is a function that is trigger on change of Main phone fields of Account Quick Create. b. When the function is triggered we are using formcontext.data.save to save the save so that we can get the GUID of the recently created record. c. On formcontext.data.save() we can assign two functions — on success and failure as parameter to .then() [Reference] d. On Success, the function will return the following response where you can get the entityType, entity id, and name of the record. e. After getting the entity id and entity type, we can use the open form to open the record as mentioned in the Code. 9. Publish all the customization that you have done on the Account Entity Demo: I hope it helps you guys!!

D365FO – HTTP Error 503. The service is unavailable

Introduction: In this blog, we will see how to resolve HTTP Error 503 – The service is unavailable in Microsoft Dynamics 365 Finance and Operations Details:  For resolving these kinds of errors, we have 2 solutions as of now. One is to do from the front end that is LCS and the second is to do from the back-end that is from Visual Studio From LCS: Reset the IIS from the LCS. Steps: 1.     Go to LCS, login 2.     Select the respective project, full details   3.     Go to Maintain -> Restart service       4.     Select IIS and confirm it     5.     Wait till the service is being restarted                       From Visual Studio: From the back-end, open the VM and follow the below steps: 1.     Login to VM 2.     Open the Visual Studio 3.     Go to Dynamics 365 tab 4.     Click on Restart IIS Express That’s it. Build the project and go to the frontend and check the output how it looks like. Thanks for reading and stay connected with us for more updates!!! Jagdish Solanki | Senior Technical Consultant | CloudFronts Business Empowering Solutions Team “Solving Complex Business Challenges with Microsoft Dynamics 365 & Power Platform”

Integrate Customers from Shopify with D365 for Finance and Operation using Microsoft flow

Using Microsoft flow you can automate and organize the flow of data between your Shopify and Microsoft D365 for Finance and Operation This the 1st part of 2. In this, I will show you how customers can be auto-created in D365 for Finance and Operation when it’s created in Shopify. First, log into Shopify as Admin. Navigate to: Settings -> Notifications -> Webhooks (Scroll to the end) -> Create Webhooks and select customer creation, and JSON format. We need a URL for sending customer details, which we will provide later. Now login to power apps or Microsoft automate with D365 account. Navigate to Flows -> New and select Instant from Blank. Now continue as shown in the below screenshots. Here the required URL will be generated after the flow has been saved. Click on the new step and search for Parse JSON. In Content select Body (parameter from previous steps). Now we need JSON schema for customers. You can find a sample Json return response from https://shopify.dev/docs/admin-api/rest/reference/customers/customer?api[version]=2020-04 Copy the response and select Generate from the sample in Powerapps and paste the response. The schema would be now generated. Click on ‘new step’. and search for Dynamics 365 for Fin & Ops. Click on Create record. Select the instance of the environment you want customers in and Entity name ‘CustomerV3’. Now you can place parameters from the previous step (Parse Json) in different fields such as. Mandatory fields that are required to create our customers are Customer account, Currency, Customer group, Company, Organization name. After the values are placed, click on Save at the top right corner. Now expand the first step and a URL will be there. Copy this URL to Shopify webhook and click Save webhook. Now let’s test this. Go to the customer’s section in Shopify and click Add Customer. Write the first name and last name for now and click save. Go to D365 F&O and navigate to All Customers. You should see a new customer created. In the next part, I will show how we can auto-create product in Shopify when created in D365 for Finance and Operation Thank you for reading!

SEARCH :

FOLLOW CLOUDFRONTS BLOG :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange