<?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/"
 version="2.0">
<channel>
<title>Customer Effective Blog</title>
<link>http://blog.CustomerEffective.com/blog/</link>
<description>Microsoft Dynamics CRM Blog from Customer Effective, CRM Experts and a Microsoft Inner Circle partner.</description>
<language>en-US</language>
<lastBuildDate>Fri, 17 Feb 2012 08:39:00 -0500</lastBuildDate>
<generator>http://www.typepad.com/</generator>
<item>
<title>Delayed IFRAME Loading</title>
<link>http://blog.CustomerEffective.com/blog/2010/02/delayed-iframe-loading.html</link>
<guid isPermaLink="true">http://blog.CustomerEffective.com/blog/2010/02/delayed-iframe-loading.html</guid>
<description>Suppose you have a CRM form that has several IFRAMES contained in multiple tabs. Loading such a form can sometimes create a performance issue on the client browser due to the frames all loading at the same time. One such...</description>
<content:encoded>&lt;p&gt;Suppose you have a CRM form that has several IFRAMES contained in multiple tabs. Loading such a form can sometimes create a performance issue on the client browser due to the frames all loading at the same time. One such way to reduce the hit on performance would be to delay loading an IFRAME until the tab it is on is clicked and made visible.&lt;/p&gt;  &lt;p&gt;What we’re going to do is create a function that sets the source of the IFRAME and then we’ll attach the function to the &lt;strong&gt;onclick&lt;/strong&gt; event of the tab. In this example, I have an IFRAME named ‘&lt;strong&gt;IFRAME_myiframe’&lt;/strong&gt; and I have set the original url to be ‘&lt;strong&gt;about:blank&lt;/strong&gt;’. I want the IFRAME to display the Bing search engine when it’s tab is displayed. &lt;/p&gt; &lt;p&gt;  &lt;h4&gt;IFRAME Load function&lt;/h4&gt;  &lt;p&gt;Setting an IFRAME source via javascript is a pretty simple piece of code that CRM customizers should be familiar with. We’re just going to wrap the code within a function:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color=&quot;#0000ff&quot;&gt;LoadFrame = function() {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; crmForm.all.IFRAME_myiframe.src=&#39;http://www.bing.com&#39;;        &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This function should be placed in the &lt;strong&gt;OnLoad&lt;/strong&gt; of the form.&lt;/p&gt;  &lt;h4&gt;The Tab Element&lt;/h4&gt;  &lt;p&gt;Next, we need to identify the name of the specific tab we want. The id of any tab on a CRM form is ‘tabXTab’ where ‘X’ represents the zero-based index of the tab. So the first tab is named &lt;b&gt;tab0Tab&lt;/b&gt;, the second is named &lt;b&gt;tab1Tab&lt;/b&gt;, and so on. The tab I want to work with is the second tab, so the element I’m looking for is named ‘&lt;strong&gt;tab1Tab&lt;/strong&gt;’.&lt;/p&gt;  &lt;p&gt;Now that we’ve identified the tab element, let’s attach the load function:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color=&quot;#0000ff&quot;&gt;document.getElementById(&#39;tab1Tab&#39;).onclick = LoadFrame;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Place this code in the form’s OnLoad event, but make sure it comes AFTER the load function we defined above.&lt;/p&gt;  &lt;p&gt;That’s all there is to it. Cheers!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8cae7e95-e80e-479d-ba11-386bbe181dc0&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/CRM&quot; rel=&quot;tag&quot;&gt;CRM&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/Javascript&quot; rel=&quot;tag&quot;&gt;Javascript&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/CRM+IFRAME&quot; rel=&quot;tag&quot;&gt;CRM IFRAME&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/CRM+Customizations&quot; rel=&quot;tag&quot;&gt;CRM Customizations&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/CRM+Scripting&quot; rel=&quot;tag&quot;&gt;CRM Scripting&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;</content:encoded>



<dc:creator>Will Wilson</dc:creator>
<pubDate>Fri, 05 Feb 2010 09:55:37 -0500</pubDate>

</item>
<item>
<title>Preventing Characters from being Entered in a Form Field</title>
<link>http://blog.CustomerEffective.com/blog/2010/01/preventing-characters-from-being-entered-in-a-form-field.html</link>
<guid isPermaLink="true">http://blog.CustomerEffective.com/blog/2010/01/preventing-characters-from-being-entered-in-a-form-field.html</guid>
<description>With CRM, we use a couple of different methods to perform data entry validation before a record is saved to the database: either form javascript, a pre-event plug-in, or some combination of both. For data validation in “real-time” (ie, you...</description>
<content:encoded>&lt;p&gt;With CRM, we use a couple of different methods to perform data entry validation before a record is saved to the database: either form javascript, a pre-event plug-in, or some combination of both.&lt;/p&gt;  &lt;p&gt;For data validation in “real-time” (ie, you want the validation to occur when the actual data is entered, rather than when the entire record is saved), form javascript is the way to go. Most javascript validation is perform in a field’s OnChange event, however you can utilize other events.&lt;/p&gt; &lt;p&gt;  &lt;h3&gt;Validating Phone Numbers&lt;/h3&gt;  &lt;p&gt;Recently, we had a client ask if we could prevent alphabetical characters from being entered into the various phone fields (telephone1, telephone2, fax, etc).&lt;/p&gt;  &lt;p&gt;Instead of using the OnChange event, I decided to try and utilize the field’s OnKeyPress event and simply nullify any invalid key strokes.&lt;/p&gt;  &lt;p&gt;The following function looks at the key being pressed and only accepts numbers 0 – 9, parentheses (), dash (-), period (.) and spaces:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;ValidateCharacters = function() {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; //&amp;#160; get key code       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var key = event.keyCode;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; //&amp;#160; only allow 0 through 9, parentheses (), dash -, period . and space       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if(!(((key &amp;gt;= 48) &amp;amp;&amp;amp; (key &amp;lt;= 57)) || key == 45 || key == 46 || key == 32 || key == 40 || key == 41)) {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; event.returnValue = false;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return false;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In CRM, to cancel a keypress, we must set the &lt;strong&gt;event.returnValue = false&lt;/strong&gt; and then have the function return &lt;strong&gt;false&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;Now we just need to hook up the function to the keypress event for the appropriate field (in this case, I’ll do the telephone1 attribute). Simply place the following code in the form’s OnLoad() event:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;document.getElementById(&#39;telephone1&#39;).onkeypress = ValidateCharacters;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;That’s all there is to it. Cheers!&lt;/p&gt;&lt;/p&gt;</content:encoded>


<category>Microsoft CRM Customizations</category>
<category>Microsoft CRM Tricks and Tips</category>

<dc:creator>Will Wilson</dc:creator>
<pubDate>Thu, 07 Jan 2010 20:58:57 -0500</pubDate>

</item>

</channel>
</rss>

<!-- ph=1 -->

