Posts

Showing posts with the label Dynamics CRM

How to open a lookup record within the same parent page in Dynamics 365 CRM using sidePane feature.

Recently I was looking for updates introduced in Dynamics 365 and came to know about sidePanes (I know, I am quite late :\), so I thought to open the lookup record within same parent page record i.e. If I click on "Parent Account" lookup field on a contact form then view the account record on the same contact page without navigating to any other page or tab or window. So, we can achieve this by following below line of codes in our JavaScript: function ExpandSidePane(executionContext) {     var formContext = executionContext.getFormContext();     var title = formContext.getAttribute("name").getValue();                                      formContext.getControl("parentaccountid").addOnLookupTagClick(function (e) {         e.getEventArgs().preventDefault();         var lookupRecord = e.getEventArgs().getTagValue().id;   ...

Get count of unique records in Power Automate (Dynamics Customer Engagement)

Image
Recently, I got a requirement in which I had to get the distinct count of records(from a custom table) associated with Appointment. To achieve this I wanted to go with the flow but since I recently have started working on Flow/ Power Automate, I had very little idea how to achieve this and hence I am adding the steps here which you can also follow to get this. Step 1: Choose the trigger point Step 2: Get the list of records for which you want count of distinct value Step 3: Initialize a variable of type array  Step 4: Add action 'Apply to each', here I am adding all Guids in array which we declared in last step Step 5: Add a 'Compose' data operation, here we will add only unique Guids from the above list collected: union(variables('AccountsArray'),variables('AccountsArray')) Step 6: In the final step we just need to count the records of unique Guids stored in the last step. length(outputs('Compose'))   Combined screenshot fyr:

How to automatically update currency exchange rates in CRM using Power Automate

Image
In this blog I am going to show how we can update the currency exchange rates in Dynamics CRM periodically using the power automate. The most common issue we face in CRM is the currency conversion since there is no out of the box option available to update the currency available in Dynamics CE. Most of us do it either manually when working with multiple currencies and that takes a lot of effort and even, we don’t have any in-built option in Power Automate to auto-update currencies in CRM. So, here are the steps which you should apply for automatically updating the currency on periodic basis. Step 1: Start with creating the custom connector. This is just to get the latest exchange rates via an API.     Goto : Data-> Custom Connectors-> New Custom Connector    Add Name and URL (api.exchangeratesapi.io/)          Click on Security and on the next page click on Definition without entering any value for authentication because the A...

WebAPI Query | Dynamics CRM | Error: Property 'field' on type 'Microsoft.Dynamics.CRM.entity' is not a navigation property or complex property

Image
Recently when I was debugging my code I got this error : Property 'field' on type 'Microsoft.Dynamics.CRM.entity' is not a navigation property or complex property'. Basically in my WebAPI query I was requesting data from Survey entity and also I was trying to read related entity(in my case it is Incident) data values so that I don't have to do another query. I have this 'Survey' entity and which has a lookup field called 'Regarding' (Schema name: regardingobjectid) which is a and can be related to any system defined entity. Simply when I used regardingobjectid in my query I got error : "Could not find a property named 'regardingobjectid' on type 'Microsoft.Dynamics.CRM.msdyn_surveyinvite'." I removed this '$select' part from the url and directly run that and found that there is field called '_regardingobjectid_value' which returned guid of that 'Regarding' lookup field. Now the new erro...

How to query paging using Dynamics 365 WebAPI (More than 5000 records)?

Recently I was working on a requirement where I had to build a WinForm application to get the records from multiple entity which looks like a very simple requirement and it was indeed but the problem came when I completed my code using WebAPI method and server-to-server authentication. The problem was the size of records which was more than 5000 and I had no idea how to query paging in this scenario. Paging using the webAPI is a bit different to using the SOAP endpoint, so I've described the structure of request that should be used and how to navigate to the next page from the response. * To execute the request for the next batch of records after maxbatchsize of request is reached, simply open a new request to the URI specified in the @odata.nextLink attribute using the same header as the initial request. Here is the example of HTTP response which you'll get. Please look at the end carefully, we got the next page link in the @odata.nextLink attribute because the respons...

How to establish Server-to-Server Authentication | Dynamics D365 | Azure | CRM Web API

Image
In this blog, I'll explain all steps that how to establish server-to-server authentication using Application User and Azure active directory. I have a very basic requirement to fetch case guid from incident entity based on ticket number from CRM using S2S authentication i.e without using any CRM user credential. Follow the below steps: Step 1:First of all we need to create an App in the Azure application directory : Goto  http://portal.azure.com  and enter your credentials. Goto Active Directory > App Registrations > New Registrations Provide all basic details as in screenshots below and click on Register Once the application is created, you will get an application ID (marked with red arrow in image below), copy and paste somewhere; this is your client ID Next step is to create Client Secret for which click on 'Certificates and Secrets' (or Keys for old Azure UI) as shown in image below. This key is used to establish connect...

How to Query Entity in Dynamics CRM Portal - AdxStudio(Using Odata method and Liquid Template Method)

There are bascially 2 ways we can query entity in CRM Customer portal: Method 1: Via Liquid Template Method 2: Via Odata In this blog I am going to show how we can query crm entity using above 2 methods one by one. Mthod 1: Using Liquid Template Follow the below steps for creating code: Step1 : Create a new Web Template where you'll have to add your fetch xml code. [? A Web Template includes the actual coded design on the record itself.  Because of this, the code can be accessed from the UI or even programmatically via SDK or API.] A liquid code contains below tags: Tags – Liquid tags are the programming logic that tells templates what to do. Tags are wrapped in: {% %} characters.   Some tags can take parameters.  Examples: if unless else elsif case and or for cycle tablerow include assign increment. Objects – Liquid objects contain attributes to output dynamic content on the page. For example, the page object contains an attribute called title that ca...

Expand and Collapse feature in PowerApps

Write the following on APP Start Code: Clear(colTreeElement);    ForAll(    TreeViewElement,    Collect(      colTreeElement,      {        ElmntName: Switch(          'Element Name',          "India",          Concatenate(            "India",            "                                     ",            "Score:4"          ),          "United States",          Concatenate(            "United States",            "                     ...
go to top image