<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jack Nutkins on Medium]]></title>
        <description><![CDATA[Stories by Jack Nutkins on Medium]]></description>
        <link>https://medium.com/@jacknutkins?source=rss-21e67b63089d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*h4PdGc6pDxK2snKaBSs2pw.jpeg</url>
            <title>Stories by Jack Nutkins on Medium</title>
            <link>https://medium.com/@jacknutkins?source=rss-21e67b63089d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 07:19:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jacknutkins/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Dynamics 365 for Sales — Embed Google Maps to show a Lat/Long Position]]></title>
            <link>https://medium.com/@jacknutkins/dynamics-365-for-sales-embed-google-maps-to-show-a-lat-long-position-61a2a8f39aa1?source=rss-21e67b63089d------2</link>
            <guid isPermaLink="false">https://medium.com/p/61a2a8f39aa1</guid>
            <category><![CDATA[dynamics-crm]]></category>
            <category><![CDATA[dynamics-365]]></category>
            <category><![CDATA[google-maps]]></category>
            <category><![CDATA[dynamics]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jack Nutkins]]></dc:creator>
            <pubDate>Mon, 18 Mar 2019 23:36:21 GMT</pubDate>
            <atom:updated>2019-03-19T10:57:04.886Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dynamics 365 for Sales — Embed Google Maps to show a Lat/Long Position</h3><p>One of our clients recently had a requirement to show lat/long position on a map on an entity form (this was not an address, but an oil rig out at sea).</p><p>I used the following post on the Microsoft forums by Elderor as a starting point:</p><p><a href="https://community.dynamics.com/crm/f/117/t/157017">Web Resource Code for Google Maps reading Latitude/Longitude - Microsoft Dynamics CRM Forum Community Forum</a></p><p>Firstly, you will need a Google Maps API key, to get one follow these instructions:</p><p><a href="https://developers.google.com/maps/documentation/javascript/get-api-key">Use API Keys | Maps JavaScript API | Google for Developers</a></p><p>Once you have your API key, on the entity you want to show the map with the marker on create 2 new fields of type Decimal Number with a precision of 6 points and place these on the form.</p><p>Then create an HTML web resource with the following content:</p><h3>Note: You must replace the following values:</h3><blockquote>YOUR-KEY: Replace this with your API key.</blockquote><blockquote>jn_latitude: Replace this with the field name that holds your latitude value.</blockquote><blockquote>jn_longitude: Replace this with the field name that holds your longitude value.</blockquote><pre>&lt;html&gt;&lt;head&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, user-scalable=no&quot;&gt;<br>  &lt;meta charset=&quot;utf-8&quot;&gt;<br>  &lt;style&gt;<br>    html, body, #map-canvas {<br>      height: 100%;<br>      margin: 0px;<br>      padding: 0px<br>    }<br>  &lt;/style&gt;<br>  &lt;script src=&quot;<a href="https://maps.googleapis.com/maps/api/js?key=AIzaSyB-92xYu1mo6WwWLfidmA5MwAZGoybB9tY">https://maps.googleapis.com/maps/api/js?key=</a>YOUR-KEY&quot;&gt;&lt;/script&gt;<br> &lt;meta&gt;&lt;meta&gt;&lt;meta&gt;&lt;/head&gt;</pre><pre>&lt;body style=&quot;word-wrap: break-word;&quot;&gt;<br>  &lt;div id=&quot;map-canvas&quot;&gt;&lt;/div&gt;<br>  &lt;script&gt;<br>   var map;<br>   function initialize() {<br>    // Retrieve the values from Dynamics CRM<br> var add1Lat = window.parent.Xrm.Page.getAttribute(&quot;jn_latitude&quot;).getValue();<br>    var add1Long = window.parent.Xrm.Page.getAttribute(&quot;jn_longitude&quot;).getValue();<br>    var add1Name = &#39;Position&#39;;<br>    // Calculate the values and set options<br> var myLatlng = new google.maps.LatLng(add1Lat, add1Long);<br>    var mapOptions = {<br>     zoom: 15,<br>     center: myLatlng<br>    }<br>    var map = new google.maps.Map(document.getElementById(&#39;map-canvas&#39;), mapOptions);<br>    var marker = new google.maps.Marker({<br>     position: myLatlng,<br>     map: map,<br>     title: add1Name<br>    });<br>   }<br>   // Load the map<br>   google.maps.event.addDomListener(window, &#39;load&#39;, initialize);<br>  &lt;/script&gt;<br> <br>&lt;/body&gt;&lt;/html&gt;</pre><p>Finally, add the newly create web resource to your form and publish the changes.</p><p>Open a record of the type above and set the values in the latitude and longitude fields and refresh the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*fJlO8CiL6n5z899s4fPYyQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61a2a8f39aa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamics 365 for Sales — JavaScript for Opening a new Email with Content]]></title>
            <link>https://medium.com/@jacknutkins/dynamics-365-for-sales-javascript-for-opening-a-new-email-with-content-ffa5e9de25cb?source=rss-21e67b63089d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffa5e9de25cb</guid>
            <category><![CDATA[dynamics]]></category>
            <category><![CDATA[dynamics-crm]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[dynamics-365]]></category>
            <dc:creator><![CDATA[Jack Nutkins]]></dc:creator>
            <pubDate>Sun, 17 Mar 2019 22:31:03 GMT</pubDate>
            <atom:updated>2019-03-17T22:34:22.398Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dynamics 365 for Sales — JavaScript for Opening a new Email with Content</h3><p>Note: This has only beed tested on D365 for Sales V9.1.</p><p>I’ve written the following function for use within D365 for Sales that takes the various parameters that are used to create a new email record, and then opens the newly generated email in a new window for further edit or review by the user:</p><pre>// var receivers = [];</pre><pre>// var receiver1 = {</pre><pre>//     LogicalName: &quot;account&quot;,</pre><pre>//     Id: &quot;6526bac2-f848-e911-a98e-00224800c0bf&quot;</pre><pre>// }</pre><pre>// receivers.push(receiver1);</pre><pre>OpenEmailDialog(&quot;Test A&quot;, &quot;BODY&quot;, &quot;1A5bf41e-ef48-e911-a98c-00224800c1e9&quot;, &quot;Contact&quot;, &quot;SystemUser&quot;, &quot;a5bff451-e29d-4fb2-964e-2c2f40b4a1e1&quot;, receivers, carbonCopies, blindCarbonCopies);</pre><pre>/*</pre><pre>Tested: Dynamics 365 V9.1</pre><pre>Function that generates an email record and opens the email for further edit or review by the user</pre><pre>subject: string</pre><pre>body: plain text or HTML</pre><pre>regardingObjectId: ID of the regarding object</pre><pre>regardingObjectLogicalName: logical name of the regarding entity</pre><pre>fromLogicalName: logical name of the sending entity</pre><pre>fromId: Id of the sending record</pre><pre>receivers: array of JSON objects receiving the email</pre><pre>carbonCopies: array of JSON objects cc&#39;ed in the email</pre><pre>blindCarbonCopies: array of JSON objects bcc&#39;ed in the email</pre><pre>*/</pre><pre>OpenEmailDialog = <em>function</em>(</pre><pre><em>subject</em>,</pre><pre><em>body</em>,</pre><pre><em>regardingObjectId</em>,</pre><pre><em>regardingObjectLogicalName</em>,</pre><pre><em>fromLogicalName</em>,</pre><pre><em>fromId</em>,</pre><pre><em>receivers</em>,</pre><pre><em>carbonCopies</em>,</pre><pre><em>blindCarbonCopies</em>) {</pre><pre>// clean parameters</pre><pre>regardingObjectLogicalName = regardingObjectLogicalName.toLowerCase();</pre><pre>regardingObjectId = regardingObjectId.toLowerCase();</pre><pre>fromId = fromId.toLowerCase();</pre><pre>fromLogicalName = fromLogicalName.toLowerCase();</pre><pre>// define the data to create new email</pre><pre><em>var</em> data =</pre><pre>{</pre><pre>&quot;subject&quot;: subject,</pre><pre>&quot;description&quot;: body</pre><pre>}</pre><pre>//Regarding Object</pre><pre><em>var</em> regardingObjectIdKey = &quot;regardingobjectid_&quot; + regardingObjectLogicalName + &quot;@odata.bind&quot;;</pre><pre><em>var</em> regardingObjectIdValue = &quot;/&quot; + regardingObjectLogicalName + &quot;s(&quot; + regardingObjectId + &quot;)&quot;;</pre><pre>data[regardingObjectIdKey] = regardingObjectIdValue;</pre><pre>//ActivityParties</pre><pre><em>var</em> parties = [];</pre><pre>//(From)</pre><pre><em>var</em> sender = {};</pre><pre><em>var</em> senderIdKey = &quot;partyid_&quot; + fromLogicalName + &quot;@odata.bind&quot;;</pre><pre><em>var</em> senderIdValue = &quot;/&quot; + fromLogicalName + &quot;s(&quot; + fromId + &quot;)&quot;;</pre><pre>sender[senderIdKey] = senderIdValue;</pre><pre>sender[&quot;participationtypemask&quot;] = 1; //From</pre><pre>parties.push(sender);</pre><pre>//(To)</pre><pre><em>var</em> i;</pre><pre>for (i = 0; i &lt; receivers.length; i++) {</pre><pre><em>var</em> receiver = {};</pre><pre><em>var</em> receiverKey = &quot;partyid_&quot; + receivers[i].LogicalName.toLowerCase() + &quot;@odata.bind&quot;;</pre><pre><em>var</em> receiverValue = &quot;/&quot; + receivers[i].LogicalName.toLowerCase() + &quot;s(&quot; + receivers[i].Id.toLowerCase() + &quot;)&quot;;</pre><pre>receiver[receiverKey] = receiverValue;</pre><pre>receiver[&quot;participationtypemask&quot;] = 2; //To</pre><pre>parties.push(receiver);</pre><pre>}</pre><pre>//(CC)</pre><pre><em>var</em> k;</pre><pre>for (k = 0; k &lt; carbonCopies.length; k++) {</pre><pre><em>var</em> cc = {};</pre><pre><em>var</em> ccKey = &quot;partyid_&quot; + carbonCopies[k].LogicalName.toLowerCase() + &quot;@odata.bind&quot;;</pre><pre><em>var</em> ccValue = &quot;/&quot; + carbonCopies[k].LogicalName.toLowerCase() + &quot;s(&quot; + carbonCopies[k].Id.toLowerCase() + &quot;)&quot;;</pre><pre>cc[ccKey] = ccValue;</pre><pre>cc[&quot;participationtypemask&quot;] = 3; //CC</pre><pre>parties.push(cc);</pre><pre>}</pre><pre>//(BCC)</pre><pre><em>var</em> j;</pre><pre>for (j = 0; j &lt; blindCarbonCopies.length; j++) {</pre><pre><em>var</em> bcc = {};</pre><pre><em>var</em> bccKey = &quot;partyid_&quot; + blindCarbonCopies[j].LogicalName.toLowerCase() + &quot;@odata.bind&quot;;</pre><pre><em>var</em> bccValue = &quot;/&quot; + blindCarbonCopies[j].LogicalName.toLowerCase() + &quot;s(&quot; + blindCarbonCopies[j].Id.toLowerCase() + &quot;)&quot;;</pre><pre>bcc[bccKey] = bccValue;</pre><pre>bcc[&quot;participationtypemask&quot;] = 4; //BCC</pre><pre>parties.push(bcc);</pre><pre>}</pre><pre>data[&quot;email_activity_parties&quot;] = parties;</pre><pre>// create email record</pre><pre>Xrm.WebApi.createRecord(&quot;email&quot;, data).then(</pre><pre><em>function</em> success(<em>result</em>) {</pre><pre><em>console</em>.log(&quot;Email created with ID: &quot; + result.id);</pre><pre>// open email record</pre><pre><em>var</em> windowOptions = {</pre><pre>openInNewWindow: true</pre><pre>};</pre><pre>Xrm.Utility.openEntityForm(&quot;email&quot;, result.id, null, windowOptions);</pre><pre>},</pre><pre><em>function</em> (<em>error</em>) {</pre><pre><em>console</em>.log(error.message);</pre><pre>// handle error conditions</pre><pre>}</pre><pre>);</pre><pre>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffa5e9de25cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>