<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>javascript on Alexander Development</title><link>https://alexanderdevelopment.net/tag/javascript/</link><description>Recent content in javascript on Alexander Development</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sat, 17 Mar 2018 21:39:19 +0000</lastBuildDate><atom:link href="https://alexanderdevelopment.net/tag/javascript/index.xml" rel="self" type="application/rss+xml"/><item><title>Setting values in a Dynamics 365 CE quick create form from the main form</title><link>https://alexanderdevelopment.net/post/2018/03/17/setting-values-in-a-dynamics-365-ce-quick-create-form-from-the-main-form/</link><pubDate>Sat, 17 Mar 2018 21:39:19 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2018/03/17/setting-values-in-a-dynamics-365-ce-quick-create-form-from-the-main-form/</guid><description>Earlier this week I was asked to populate a field in a Dynamics 365 Customer Engagement quick create form with a value from a field on the main form. Unfortunately, the main form would not be saved at the time the quick create form was opened, so the value couldn&amp;rsquo;t be read from the database.</description></item><item><title>A Dynamics 365 local message listener for web client notifications - part 2</title><link>https://alexanderdevelopment.net/post/2017/07/21/a-dynamics-365-local-message-listener-for-web-client-notifications-part-2/</link><pubDate>Fri, 21 Jul 2017 12:30:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2017/07/21/a-dynamics-365-local-message-listener-for-web-client-notifications-part-2/</guid><description>In part one of this series, I discussed an approach for passing notifications from local applications to the Dynamics 365 web client through a message listener process that runs on an end user&amp;rsquo;s PC. Today I will show the code I used to build the message listener and the code to consume notifications in Dynamics 365.</description></item><item><title>Automatically executing HTTP POST requests in Dynamics 365 iframes - part 2</title><link>https://alexanderdevelopment.net/post/2017/07/10/automatically-executing-http-post-requests-in-dynamics-365-iframes-part-2/</link><pubDate>Mon, 10 Jul 2017 21:48:55 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2017/07/10/automatically-executing-http-post-requests-in-dynamics-365-iframes-part-2/</guid><description>Several months ago, I wrote a post that showed how to automatically display the results of an HTTP POST request inside a Dynamics 365 iframe. I was working on a project last week where I was tried to use that approach, but I ran into some problems, so today I will present an updated approach.</description></item><item><title>Dynamics CRM AngularJS demo solution deep dive - the editor form</title><link>https://alexanderdevelopment.net/post/2016/11/11/dynamics-crm-angularjs-demo-solution-deep-dive-the-editor-form/</link><pubDate>Fri, 11 Nov 2016 00:10:15 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2016/11/11/dynamics-crm-angularjs-demo-solution-deep-dive-the-editor-form/</guid><description>Earlier this week I shared a sample solution that shows how to build a custom Dynamics CRM data editor with AngularJS. As I described in that post, the actual editor relies on three custom web resource components (not including the AngularJS and ES6 promise libraries):
index.htm - This is the editor form.</description></item><item><title>AngularJS demo solution for Dynamics CRM</title><link>https://alexanderdevelopment.net/post/2016/11/07/angularjs-demo-solution-for-dynamics-crm/</link><pubDate>Mon, 07 Nov 2016 13:30:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2016/11/07/angularjs-demo-solution-for-dynamics-crm/</guid><description>Lately I&amp;rsquo;ve started using AngularJS to build web resources for custom data editors and viewers in Dynamics CRM. Once you get the hang of Angular, it&amp;rsquo;s not that hard, but it did take me some time to figure out exactly how to work with it as part of a CRM solution.</description></item><item><title>Working with Dynamics CRM users assigned roles using JavaScript</title><link>https://alexanderdevelopment.net/post/2016/11/03/working-with-dynamics-crm-users-assigned-roles-using-javascript/</link><pubDate>Thu, 03 Nov 2016 19:08:28 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2016/11/03/working-with-dynamics-crm-users-assigned-roles-using-javascript/</guid><description>Today turned out to be one of those days where I got multiple requests for quick Dynamics CRM 2015 JavaScript help on a few projects. A colleague asked me for help showing a field on a form if a user is assigned a role and keeping it hidden otherwise. Instead of just hardcoding everything, I decided to take a more general approach and write a universal role assignment checking function that has parameters for the functions to execute if the user is or is not in the role when the role checking is called.</description></item><item><title>Checking Dynamics CRM user team membership with organization data service</title><link>https://alexanderdevelopment.net/post/2016/11/03/checking-dynamics-crm-user-team-membership-with-organization-data-service/</link><pubDate>Thu, 03 Nov 2016 15:42:47 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2016/11/03/checking-dynamics-crm-user-team-membership-with-organization-data-service/</guid><description>With the all the recent news about Dynamics 365, this post probably seems a tad outdated, but today I had a colleague ask me for a way to check whether a user is a member of a team in a Dynamics CRM 2015 organization using JavaScript. Without further commentary, here goes:</description></item><item><title>Custom call handling logic with the Dynamics CRM USD generic listener</title><link>https://alexanderdevelopment.net/post/2016/10/22/custom-call-handling-logic-with-the-dynamics-crm-usd-generic-listener/</link><pubDate>Sat, 22 Oct 2016 16:05:10 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2016/10/22/custom-call-handling-logic-with-the-dynamics-crm-usd-generic-listener/</guid><description>I was recently working on a Dynamics CRM Unified Service Desk project where I needed to populate a custom search form with call details instead of doing a direct search for a matching record in CRM. I didn&amp;rsquo;t want to write my own CTI adapter, so I investigated using the USD generic listener adapter.</description></item><item><title>Easy dependent picklists for Dynamics CRM</title><link>https://alexanderdevelopment.net/post/2016/10/06/easy-dependent-picklists-for-dynamics-crm/</link><pubDate>Thu, 06 Oct 2016 22:25:11 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2016/10/06/easy-dependent-picklists-for-dynamics-crm/</guid><description>I&amp;rsquo;ve created a new solution for creating dependent picklists on Dynamics CRM forms that requires no coding to implement. You can download it from my Crm-Sample-Code GitHub repository here: https://raw.githubusercontent.com/lucasalexander/Crm-Sample-Code/master/misc-code-samples/easydependentpicklists.js
Assume you have three picklists with related options like in the list below:
lpa_level1picklist 1 2 lpa_level2picklist 1a 1b 2a 2b lpa_level3picklist 1a1 1a2 1b1 2a1 You can represent a tree of possible options like this: 1 -&amp;gt; 1a -&amp;gt; 1a1 1 -&amp;gt; 1a -&amp;gt; 1a2 1 -&amp;gt; 1b -&amp;gt; 1b1 2 -&amp;gt; 2a -&amp;gt; 2a1 2 -&amp;gt; 2a -&amp;gt; 1a1 2 -&amp;gt; 2b</description></item><item><title>Downloading Dynamics CRM attachments with JavaScript</title><link>https://alexanderdevelopment.net/post/2016/09/29/downloading-dynamics-crm-attachments-with-javascript/</link><pubDate>Thu, 29 Sep 2016 23:30:34 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2016/09/29/downloading-dynamics-crm-attachments-with-javascript/</guid><description>I ran into a requirement this week where I needed to give Dynamics CRM users an easy way to download PDF attachments from a set of links in an iframe. I thought it would be easy enough to just grab the corresponding annotation id and pass it to the CRM download.</description></item><item><title>Automatically executing HTTP POST requests in Dynamics CRM iframes</title><link>https://alexanderdevelopment.net/post/2016/09/09/automatically-executing-http-post-requests-in-dynamics-crm-iframes/</link><pubDate>Fri, 09 Sep 2016 17:57:12 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2016/09/09/automatically-executing-http-post-requests-in-dynamics-crm-iframes/</guid><description>The Dynamics CRM SDK allows you to set the source URL for an iframe control on a form, and that is fine if all you need to do is load web pages that are accessible via HTTP GET requests. If you need to automatically display the results of an HTTP POST request inside an iframe, it&amp;rsquo;s a bit more challenging.</description></item><item><title>Get next case functionality for CRM Unified Service Desk</title><link>https://alexanderdevelopment.net/post/2015/10/08/get-next-case-functionality-for-crm-unified-service-desk/</link><pubDate>Thu, 08 Oct 2015 02:41:36 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2015/10/08/get-next-case-functionality-for-crm-unified-service-desk/</guid><description>Last week I shared an approach for implementing next case functionality for Dynamics CRM so that users can get the &amp;ldquo;next&amp;rdquo; case to work from a queue just by clicking a button. In today&amp;rsquo;s post I will show an easy way to add the same functionality to Unified Service Desk (USD), but as an added bonus the case will also open in a new session tab.</description></item><item><title>Get next case functionality for Dynamics CRM</title><link>https://alexanderdevelopment.net/post/2015/10/02/get-next-case-functionality-for-dynamics-crm/</link><pubDate>Fri, 02 Oct 2015 02:13:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2015/10/02/get-next-case-functionality-for-dynamics-crm/</guid><description>Dynamics CRM offers sophisticated tools for working with cases and service queues, but sometimes users just want a quick and simple way to get the next case to work. In today&amp;rsquo;s post, I&amp;rsquo;ll share an easy way to implement this functionality in your Dynamics CRM organization.
There are three components to my approach:</description></item><item><title>Authenticating from a Node.js client to Dynamics CRM via AD FS and OAuth2</title><link>https://alexanderdevelopment.net/post/2015/01/24/authenticating-from-a-node-js-client-to-dynamics-crm-via-ad-fs-and-oauth2/</link><pubDate>Sat, 24 Jan 2015 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2015/01/24/authenticating-from-a-node-js-client-to-dynamics-crm-via-ad-fs-and-oauth2/</guid><description>Last week I decided to finally take a look at using OAuth2 as an authentication protocol with Dynamics CRM. I wanted to understand how it could enable non-Windows clients to consume CRM data. As it turns out, I was unable to find any documentation or comprehensive code samples for non-Windows clients, so I put together my own Node.</description></item><item><title>A Better Dynamics CRM E-mail Editor With TinyMCE (updated for IE8 and 9)</title><link>https://alexanderdevelopment.net/post/2013/08/15/a-better-dynamics-crm-e-mail-editor-with-tinymce-updated-for-ie8-and-9/</link><pubDate>Thu, 15 Aug 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/08/15/a-better-dynamics-crm-e-mail-editor-with-tinymce-updated-for-ie8-and-9/</guid><description>When I developed the JavaScript for my A Better Dynamics CRM E-mail Editor With TinyMCE post back in June, I tested it in both Chrome and IE10. Since then I have gotten a few reports of it not working in IE8 or IE9. Initially, I thought there might be a problem with the way the earlier versions of IE were handling the protocol-relative URLs to the TinyMCE CDN script, but it turned out that the script just wasn&amp;rsquo;t loading properly when the editor popup was initially launched.</description></item><item><title>A Better Dynamics CRM E-mail Editor With Markdown</title><link>https://alexanderdevelopment.net/post/2013/07/09/a-better-dynamics-crm-e-mail-editor-with-markdown/</link><pubDate>Tue, 09 Jul 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/07/09/a-better-dynamics-crm-e-mail-editor-with-markdown/</guid><description>Last month I wrote a post called A Better Dynamics CRM E-mail Editor With TinyMCE in which I showed how to create a better Dynamics CRM e-mail editing interface using TinyMCE. Since then I have done some work with Markdown, and I decided it would be an interesting exercise to make a Markdown-enabled e-mail editor.</description></item><item><title>Easy HTML Formatting for Comments in Orchard Using Markdown</title><link>https://alexanderdevelopment.net/post/2013/07/08/easy-html-formatting-for-comments-in-orchard-using-markdown/</link><pubDate>Mon, 08 Jul 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/07/08/easy-html-formatting-for-comments-in-orchard-using-markdown/</guid><description>I recently moved this site from BlogEngine.NET to Orchard, and I decided I wanted to offer some basic HTML formatting (bold, italic, hyperlinks, etc.) functionality for comments, but I didn&amp;rsquo;t want to do any significant amount of coding. After some research I realized that Markdown syntax would be the easiest way to let my visitors add HTML to their comments, and I could enable it with just a few bits of JavaScript.</description></item><item><title>A Better Dynamics CRM E-mail Editor With TinyMCE</title><link>https://alexanderdevelopment.net/post/2013/06/26/a-better-dynamics-crm-e-mail-editor-with-tinymce/</link><pubDate>Wed, 26 Jun 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/06/26/a-better-dynamics-crm-e-mail-editor-with-tinymce/</guid><description>I think most people would agree the e-mail editing functionality in the Dynamics CRM web UI leaves a lot to be desired. One of the most embarrassing moments I experienced on a recent project was when I had to explain to the client the convoluted process that would need to be used to add a corporate logo to outbound e-mails.</description></item><item><title>Creating a dynamic dialog launcher menu for Dynamics CRM (FetchXML style)</title><link>https://alexanderdevelopment.net/post/2013/06/03/creating-a-dynamic-dialog-launcher-menu-for-dynamics-crm-fetchxml-style-2/</link><pubDate>Mon, 03 Jun 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/06/03/creating-a-dynamic-dialog-launcher-menu-for-dynamics-crm-fetchxml-style-2/</guid><description>Last month I wrote a post about how to create a web resource dialog &amp;ldquo;launcher&amp;rdquo; that you can embed in a CRM form (both classic and updated modes) with JavaScript and an OData query. In today&amp;rsquo;s post, I will show how to do the same thing using a FetchXML query. There are four changes you need to make to the web resource from the previous post.</description></item><item><title>Creating a dynamic dialog launcher menu for Dynamics CRM</title><link>https://alexanderdevelopment.net/post/2013/05/17/creating-a-dynamic-dialog-launcher-menu-for-dynamics-crm/</link><pubDate>Fri, 17 May 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/05/17/creating-a-dynamic-dialog-launcher-menu-for-dynamics-crm/</guid><description>I love Dynamics CRM dialogs. In fact, I think they are one of the best features of CRM 2011. What I don&amp;rsquo;t like about dialogs is how the user has to run them when working with a entity record. On a &amp;ldquo;classic&amp;rdquo; mode form, the user has to go to the ribbon, click start dialog and then find the dialog in a list.</description></item><item><title>Displaying FetchXML results with XSLT on the client side in a Dynamics CRM 2011 web resource</title><link>https://alexanderdevelopment.net/post/2013/02/11/displaying-fetchxml-results-with-xslt-on-the-client-side-in-a-dynamics-crm-2011-web-resource/</link><pubDate>Mon, 11 Feb 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/02/11/displaying-fetchxml-results-with-xslt-on-the-client-side-in-a-dynamics-crm-2011-web-resource/</guid><description>A few weeks back, I wrote a post that showed how to retrieve and display FetchXML using jQuery in a Dynamics CRM web resource. In that example, I used jQuery&amp;rsquo;s each() method to iterate through each result and append them to an HTML element on the page. Using each() is a good approach if you need to actually do something with each row, but if you just want to display data, XSLT is a much easier way to do it.</description></item><item><title>Better line charts in Dynamics CRM 2011 - part II</title><link>https://alexanderdevelopment.net/post/2013/01/27/better-line-charts-in-dynamics-crm-2011-part-ii/</link><pubDate>Sun, 27 Jan 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/01/27/better-line-charts-in-dynamics-crm-2011-part-ii/</guid><description>In part I of this series, I showed how to query Microsoft Dynamics CRM for aggregate data using FetchXML and then pass the results to Flot to generate a line chart. In this second part, I will expand on that to show how to query for and chart multi-series data. For my example today, I will be creating a chart that shows the number of contacts created by date and state (address, not statecode).</description></item><item><title>Better line charts in Dynamics CRM 2011 - part I</title><link>https://alexanderdevelopment.net/post/2013/01/24/better-line-charts-in-dynamics-crm-2011-part-i/</link><pubDate>Thu, 24 Jan 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/01/24/better-line-charts-in-dynamics-crm-2011-part-i/</guid><description>Earlier this week I posted an entry about using FetchXML and JQuery in a Dynamics CRM 2011 web resource. The reason I first started looking at those two together was that I wanted to see if I could generate better looking line charts than are available out of the box (spoiler alert: I did).</description></item><item><title>FetchXML + jQuery in a Dynamics CRM 2011 web resource</title><link>https://alexanderdevelopment.net/post/2013/01/21/fetchxml-jquery-in-a-dynamics-crm-2011-web-resource/</link><pubDate>Mon, 21 Jan 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/01/21/fetchxml-jquery-in-a-dynamics-crm-2011-web-resource/</guid><description>Over the weekend I started looking at a hobby project that involved querying and working with aggregate data from Dynamics CRM 2011 inside a hosted web resource using jQuery. Initially had I planned to use the OData/REST endpoint since that is much sexier than SOAP lately, but after a quick web search I realized that OData doesn&amp;rsquo;t support &amp;ldquo;group by&amp;rdquo; queries, so that left me looking at FetchXML.</description></item><item><title>Dynamically setting field requiredlevel attributes in Dynamics CRM 2011</title><link>https://alexanderdevelopment.net/post/2013/01/16/dynamically-setting-field-requiredlevel-attributes-in-dynamics-crm-2011/</link><pubDate>Wed, 16 Jan 2013 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2013/01/16/dynamically-setting-field-requiredlevel-attributes-in-dynamics-crm-2011/</guid><description>One of the things I like best about the Dynamics CRM 2011 form object model is that it exposes the requiredlevel attribute for form fields, so you can dynamically set fields as required or not in response to user actions. This is great if you have different types of a single entity and business rules dictate that you must capture different data values for each type.</description></item><item><title>Dynamically setting field requirement levels in Microsoft Dynamics CRM</title><link>https://alexanderdevelopment.net/post/2011/03/21/dynamically-setting-field-requirement-levels-in-microsoft-dynamics-crm/</link><pubDate>Mon, 21 Mar 2011 00:00:00 +0000</pubDate><guid>https://alexanderdevelopment.net/post/2011/03/21/dynamically-setting-field-requirement-levels-in-microsoft-dynamics-crm/</guid><description>In Dynamics CRM you may have a field you want to be required some of the time, but not required, or maybe not even enabled, the rest of the time. In this post I&amp;rsquo;ll show you how to dynamically enable/disable and set/unset the required attribute of CRM form fields using JavaScript.</description></item></channel></rss>