Skip to main content

Posts

Showing posts from 2019

How to call a Dynamics 365 Action with Input parameters from Logic App or Microsoft Flow

How to call a Dynamics 365 Action with Input parameters from Logic App or Microsoft Flow On my previous post How to call Dynamics 365 Action from Logic App. I have described how to call an Action from a Logic App or Microsoft Flow. So you can refer that post to set up your configuration. This post is going to be about calling an Action that has Input parameters from Logic App or Microsoft Flow. We are going to use the Http Request. As a Sample Action we are going to create a global Action with 2 Input parameters , S tring EntityReference After we have set up our Http Request with the proper Authentication we will call the Sample Action as follows Parameters Inputs are passed under the body, for any EntityReference the following entries are expected : type → “Microsoft.Dynamics.CRM.{{entity name}} id → Guid as string Happy Coding :)
How to Run Logic Apps for more than an hour while using Until Action. I was working on a Logic App that pulls data from Dynamics 365. Since I have more that few thousands of records i will take multiple hours for the Logic App to complete. Apparently the Using Action by default can run only for an hour, even if your custom defined condition is not satisfied. So what is causing the Time Out. As you can see under Change Limits we have two entries, Count = defines how many times it will iterate Timeout = defines how many hours it will run So to increase run time of Until Action you just have to increase the entry under Timeout. Make sure to follow the following format PT{Hours}H PT1H = 1 hour PT2H = 2 hours PT3H = 3hours ... I think you get the logic. Happy Coding :)

How to call Dynamics 365 Action from Logic App.

How to call Dynamics 365 Action from Logic App. You might have stumbled in a scenario where you have an Action in Dynamics 365 and you want to trigger it from a Logic App. As you know the Dynamic 365 Connector has good features, but it does not have the ability to call an Action at least as far as I know. You can solve this by leveraging the HTTP call in logic App, to have a better understanding you can read on the following article https://docs.microsoft.com/en-us/azure/connectors/connectors-native-http . So the idea is to create a Rest API call that triggers the Dynamics 365 Action. Prerequisite: Generate your REST API call You can use CRM REST Builder In general though this is the generic path to call an action {{clientUrl}}/api/data/v9.1/{{Entity Name}}({{Record Guid}})/Microsoft.Dynamics.CRM.{{Unique Name of Action}} Get the following information for Active Directory OAuth authentication Tenant ID Audience which is the

Why do you need an inventory of Browsers? IE 11

As a developer you need to know which browsers are used by Dynamic 365 Users in your organization. The reason for this is quite simple, it will dictate your way of programming when it comes to scripting. Most browsers majority of the time react the same way to JavaScript giving you a more predictable outcome, when it comes to IE 11 you have to be more careful, even though JavaScript has evolved since ECMAScript 5 IE 11 still using ECMAScript 5 and I am sure you have a handful of users that are on IE 11 in your organization. ECMAScript 5 has so many limitation, yes you can use application like Babel to convert your code to ECMAScript 5 while coding with the latest version, if you have seen the output of Babel its not that palatable for my taste, it injects code to mitigate the shortcoming of ECMAScript 5, if you work with many developers I don’t think you are inclined to introduce a new process to generate your JavaScript files. There are few things you can do Short term solu

Dynamics 365 Open Quick Create Form and Save/Refresh calling record

If you are working in a scenario where you have to open Quick Create Form through JavaScript and save/refresh the calling record after the quick create form has been saved, you have few choices. In this article I will show you how you can leverage the async and await operators in JavaScript to solve this scenario. First thing let’s try to define async and await Async : - pretty much a function that returns a promise Await : - makes JavaScript wait until the promise has been settled. First thing let’s define the function that is going to Open Quick Create Form function QuickCreate() {     var entityFormOptions = {};     entityFormOptions[ "entityName" ] = "contact" ;     entityFormOptions[ "useQuickCreateForm" ] = true ;     // Set default values for the Contact form     var formParameters = {};     formParameters[ "firstname" ] = "Sample" ;     formParameters[ "lastname" ] = "Contact

Why is it a bad idea to hardcode workflow id in your code?

You might have faced a scenario where you have to trigger workflows or an actions through plugins or JavaScript code. And you might have hard coded the workflow id in your code. There are few things that I would like you to reconsider before you get tempted to hardcode the workflow id in your code. Take a workflow name that you have been working lately and replace it on the following fetchxml. < fetch top = " 50 " >   < entity name = " workflow " >     < attribute name = " versionnumber " />     < attribute name = " name " />     < filter >       < condition attribute = " name " operator = " eq " value = " Workflow Name " />       < condition attribute = " statecode " operator = " eq " value = " 1 " />     </ filter >     < order attribute = " versionnumber " />   </ entity > </

Dynamic 365 SetStateDynamicEntity

Dynamic 365 SetStateDynamicEntity  I was working on a plugin that has to fire when record gets deactivated or activated. To handle this scenario I had to use SetStateDynamicEntity Message. When it comes to the plug-in code you have to look for “ EntityMoniker” as an EntityReferece on the context. Here is a snippet of code: if (context.InputParameters.Contains( "EntityMoniker" ) && context.InputParameters[ "EntityMoniker" ] is EntityReference ) To retrieve the State and Status values you can use the following code OptionSetValue state = ( OptionSetValue )context.InputParameters[ "State" ]; OptionSetValue status = ( OptionSetValue )context.InputParameters[ "Status" ]; Here is where things got interesting, if you are like me you are expecting the right value for the status “ statucode field value”, instead I started getting Status=-1; Which is not a valid value for the OptionSet field. Which made

Microsoft Dynamics 365 Developer Toolkit for Visual Studio 2017

Microsoft Dynamics 365 Developer Toolkit for Visual Studio 2017 If you are used to working with Microsoft Dynamics 365 Developer Toolkit in Visual Studio 2015 you will realize quickly that Microsoft didn’t provide a new version for Visual Studio 2017. Here are step to take Microsoft Dynamics 365 Developer Toolkit for Visual Studio 2015 and make it functional for Visual Studio 2017 1.        Download Microsoft Dynamics 365 Developer Toolkit from here 2.        Uncompressed the .vsix and open folder Locate extension.vsixmanifest 1.        Open in a text editor in my case I used Notepad and locate the following <Installation>     <!--<InstallationTarget Version="[11.0,12.0)" Id="Microsoft.VisualStudio.Pro" TargetPlatformVersion="4.0" />-->     <InstallationTarget Version="[11.0,14.0]" Id="Microsoft.VisualStudio.Premium" />     <InstallationTarget Version="[11.0,14.0]" Id=&qu

Dynamics 365 Creating Business Rule that work on Views

Business Rule on Views I was working on a business rule and noticed while it worked on the form it was not working on a system View. The Business Rule Scope was set up for Entity so logically this had to work, to my surprise the BR was working as expected on the Form and was not taking effect on the System View. I started doing some research and saw that many people are writing JavaScript to handle this issue, still I was not convinced that this can be done only with JavaScript. I approach the problem going back to the basics, for a Business Rule to work on a Form the Condition must contain a field on the form. Why not apply the same logic for The System View? Went through the System View to see if there was a field I can use for the condition, once I identified the right field I updated the Condition on my business Rule to a Field that was a column on the System View, upon activation of the BR I noticed it was working properly. So when you face this kind of  issue make su