Tag Archives: Dynamics 365
Filtering Entity Lookups based on field value
I have a contact record with a role option set field with options Billing, Decision Maker, Client, Influencer. The Requirement is to only show billing contacts i.e. contacts with role billing related to the account selected on the Opportunity in the lookup of the contacts on the Opportunities. Let’s see how I to filtered the contacts lookup to just show billing contacts : Step 1: Create a contacts view such that the role is billing(or any field on which you want to filter is set to the value by which you want to filter that record ). Step 2: Set the filter criteria of the contacts lookup field on the opportunity as shown below. In the Additional properties turn of the view selector and set the default view to the view you created in #1Step 1 In the Field Behavior Tick the “disable most recently used items for this field”. Now you will only see contacts with role billing in the lookup of the contacts on the opportunity form. Hope this helps! Thank you.
Send a message/notification on Microsoft Teams as soon as an Opportunity is created in Dynamics 365 via Azure Logic Apps.
In this blog we will see the steps in order to send a automated message via Teams as soon as an Opportunity is created in Microsoft Dynamics 365. Step 1: Go to portal.azure.com and select the Azure Logic App Resource. Step 2: Enter all the details such as the Name, Resource Group, Subscription, Region, etc. required while creating a Logic App. Step 3: Select the Dynamics 365 trigger When a record is updated. Step 4: Select Opportunities entity after setting by the Dynamics 365 CRM connection Step 5: Set the data refresh time as required. Step 6: Select the IF action in the next step and the condition would be status_label=won for true. Step 7: Inside True Block select Post a message in a chat or channel option. You can also handle the condition for False block, but in this case we can leave it blank. Step 8: You can post this message in a Group, Channel or send it as a Personal chat. Step 10: Wait for the trigger successful notification. Step 11: Go to Dynamics 365 CRM and navigate to opportunities entity. Step 12: Open a test opportunity or create one if doesn’t exist and close the opportunity as won. Step 13: As soon as you closed this opportunity you may have received the following message. Hence in this blog we saw how we can send messages on MS Teams using Azure Logic Apps on triggering certain conditions. Hope this helped!
Quick Tip – Duplicate Fields from a Table to another Table
Hello,Consider a scenario where we need to have a table (entity) which is a replica of other table or you need some fields replicated into another table. This tool will save a lot of precious time. Let’s say I have a table called ‘Scoping’ and I want fields from that data replicated into another table called ‘ScopingClone’. Steps you’ll take to do this in a time-efficient manner. Step 1: Create a new Table/Entity. (In my case, I created ScopingClone) Step 2: Navigate to XrmToolBox and install ‘Clone Field Definitions‘, connect to your environment and open the tool. As you can see, the fields that I selected are successfully cloned. I hope you found this blog useful.
SharePoint Integration with Dynamics 365
In this blog we’ll see how to integrate SharePoint with Dynamics 365. Step 1- Configure SharePoint Option in Dynamics 365 Document Management option. Go to Advanced settings -> Document Management. Step 2- In Document Management select “Enable Server-based SharePoint Integration” Step 3- Now in the pop-up screen provide SharePoint site location as “Online” then proceed to next. Step 4- Now provide a valid SharePoint URL and click on finish. Step 5- Enable Share point Document setting for Entities using Document Management Settings. Step 6- Now in the Pop-up screen select the entities that you want to use to manage SharePoint documents. You will find some entities like Account are already Enabled and if you want you can enable other entities. We can also add custom entities if required. Step 7- Check Based on entity, document libraries and folders that are based on Account entity are automatically created on SharePoint site. Step 8- We can store a document for an Account or for any other entity in SharePoint. Open an Account and click on Related tab to choose Document option. Hope this helps!!
Fields in Customer and Vendor Posting Groups in D365 Business Central
CUSTOMER POSTING GROUPS Customer Posting Groups determines the account receivables account. 1. In the search option, enter Customer Posting Groups and then choose related link. 2. In the Code Field, type unique identifier. 3. In the description field, type description of Customer posting group. 4. In each relevant account field, enter the G/L account that will post the transaction accordingly. Receivable Account: This is a summary account where all the entries from customers will end up in balance sheet. Service Charge Account: This is a fee account where any fee you Charge to the customer when invoicing will end up here. Payment Discount Dr. Account: This account represents cash discounts given to the customers, then the sum representing the difference in original amount and what they’ve actually paid. This will be in debit field. Payment Discount Cr. Account: This account represents cash discounts given to the customers, then the sum representing the difference in original amount and what they’ve actually paid. This will be in credit field. Interest Account: It is an account to which, if you issue reminders or finance charge memos with interest on them, this interest revenue will be posted to this account. Additional Fee Account: This is where the reminder fees and finance charge momos will be posted when they are issued. Add. Fee per line Account: This is where reminder account will be posted if you have a reminder amount on each line of your remainders. Invoice rounding Account: This is where invoice rounding will be posted. Debit Curr. Appln. Rndg. Acc/ Credit Curr. Appln. Rndg. Acc: Both accounts are same except one is Dr and other is Cr. This account is particularly used when you are applying an entry on your customers from different currencies. E.g. Invoice is in USD but payment is in EUROS, in this case rounding difference will be posted to this account. Debit Rounding Account/ Credit Rounding Account: This is same as above mention field except the difference is of same currency and needed a slight adjustment. These accounts will therefore be used to Debit or Credit respectively. Payment tolerance Debit account/ Payment tolerance Credit account: These accounts are used to have a payment tolerance towards customers. e.g. If the customers is Invoiced USD 105 but customer pays only USD 100, and you have set a tolerance for 5USD which means the difference will be posted to these two accounts. Assign Customer Posting Groups to Customers 1. In the search option, enter Customers and then choose related link. 2. Open a Customer Card. 3. Expand Invoicing Tab, in Customer posting group field enter relevant details. VENDOR POSTING GROUPS Vendor Posting Groups determines the account payable account. 1. In the search option, enter Vendor Posting Groups and then choose related link. 2. In the Code Field, type unique identifier. 3. In the description field, type description of Vendor posting group. 4. In each relevant account field, enter the G/L account that will post the transaction accordingly, Payables Account: This is a summary account where all the transaction from vendors will end up in balance sheet. Service Charge Account: This is a account where you can put any service charge that might come from the vendor. Payment Discount Dr. Account: If you pay your vendor ahead to time and get a cash discount, a debit entry will end up in this account. Payment Discount Cr. Account: This account represents cash discounts given to the customers, then the sum representing the difference in original amount and what they’ve actually paid. This will be in credit field. Invoice Rounding Account: This account is used when an invoice from the vendor has to be rounded. Debit Curr. Appln. Rndg. Acc/ Credit Curr. Appln. Rndg. Acc: This account is used when the different Currencies have to be applied to each other and rounding has to be carried out. Debit Rounding Account/ Credit Rounding Account: This is used when you settle the outstanding amount in same currency but a little rounding off is to be done. Payment tolerance Debit account/ Payment tolerance Credit account: These accounts are used to have a payment tolerance towards vendors. Assign Vendor Posting Groups to Vendors 1. In the search option, enter Vendors and then choose related link. 2. Open a Vendor Card. 3. Expand Invoicing Tab, in Vendor posting group field enter relevant details.
Adding a button on ribbon and on click, opens quick create form using ribbon workbench in XRM ToolBox
In this blog, we’ll see how to create a button on ribbon by using ribbon workbench in XRM toolbox and on click, open quick create form. Step 1- Insert a ribbon button on any required record form using ribbon workbench on XRM toolbox. Step 2- Name the ribbon button (anything as required) Step 3- Add button properties- Give ID name Label name Icon for the button Step 4- Add the following code to open a quick create form on click of the button var RecordaMeeting = { //RecordaMeeting.OpenRecord OpenRecord: function (primaryControl) { var entityFormOptions = {}; entityFormOptions[“entityName”] = “Add the entity name”; entityFormOptions[“useQuickCreateForm”] = true; var formParameters = {}; // Open the form. Xrm.Navigation.openForm(entityFormOptions, formParameters).then( function (success) { console.log(success); }, function (error) { console.log(error); }); }, Step 5- After adding the script, add the command for the button- Web resources library name Web resources function name CRM Parameter: PrimaryControl Step 6- Add command on button properties. Step 7- Publish the button. Screenshots of implementation: Step 8- Button appears on the ribbon for the required entity. Step 9- On click of button, quick create form opens. Hope this helps!!
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/