<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Trace.WriteLine(_blogTitle); &#187; Javascript</title> <atom:link href="http://www.langalaxy.de/tag/javascript/feed/" rel="self" type="application/rss+xml" /><link>http://www.langalaxy.de</link> <description>Random output</description> <lastBuildDate>Fri, 28 Oct 2011 17:20:03 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Howto: Get label for an attribute with JavaScript</title><link>http://www.langalaxy.de/2010/05/howto-get-label-for-an-attribute-with-javascript/</link> <comments>http://www.langalaxy.de/2010/05/howto-get-label-for-an-attribute-with-javascript/#comments</comments> <pubDate>Wed, 19 May 2010 19:49:23 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[Form Scripting]]></category> <category><![CDATA[HowTo]]></category> <category><![CDATA[Javascript]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=429</guid> <description><![CDATA[If you have to retrieve the label of an attribute in a form script, you have two options. The first one, is of course not supported, but quick and easy to implement. function GetFieldLabel&#40;fieldname&#41; &#123; var field = crmForm.all&#91;fieldname+ '_c'&#93;; &#160; if &#40;field != null&#41;&#123; return field.firstChild.firstChild.nodeValue; &#125; else &#123; return ''; &#125; &#125; &#160; [...]]]></description> <content:encoded><![CDATA[<p>If you have to retrieve the label of an attribute in a form script, you have two options. The first one, is of course not supported, but quick and easy to implement.</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> GetFieldLabel<span style="color: #009900;">&#40;</span>fieldname<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> field <span style="color: #339933;">=</span> crmForm.<span style="color: #660066;">all</span><span style="color: #009900;">&#91;</span>fieldname<span style="color: #339933;">+</span> <span style="color: #3366CC;">'_c'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>field <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> field.<span style="color: #660066;">firstChild</span>.<span style="color: #660066;">firstChild</span>.<span style="color: #660066;">nodeValue</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>GetFieldLabel<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'subject'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>The other option is, to retrieve the label for the user language from the crm service. I will cover this in another article.</p> ]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2010/05/howto-get-label-for-an-attribute-with-javascript/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Howto: Detect external request with JavaScript</title><link>http://www.langalaxy.de/2010/05/howto-detect-external-request-with-javascript/</link> <comments>http://www.langalaxy.de/2010/05/howto-detect-external-request-with-javascript/#comments</comments> <pubDate>Fri, 30 Apr 2010 22:19:50 +0000</pubDate> <dc:creator>ckeller</dc:creator> <category><![CDATA[Dynamics CRM]]></category> <category><![CDATA[CRM 4]]></category> <category><![CDATA[Form Scripting]]></category> <category><![CDATA[HowTo]]></category> <category><![CDATA[Javascript]]></category><guid
isPermaLink="false">http://www.langalaxy.de/?p=406</guid> <description><![CDATA[If you have activated Internet Facing Deployment for your CRM system, it could be necessary to detect if a request comes from outside your network or from your internal network. For example, if you integrate a web application with an IFrame, you have to set different addresses for internal and external access. Or, if the [...]]]></description> <content:encoded><![CDATA[<p>If you have activated Internet Facing Deployment for your CRM system, it could be necessary to detect if a request comes from outside your network or from your internal network.</p><p>For example, if you integrate a web application with an IFrame, you have to set different addresses for internal and external access. Or, if the application is only accessible from inside your network, you can show a message that it is not available for external users.</p><p>With help of Form Scripting you can detect an external request with little effort. You can make use of the function <a
href="http://msdn.microsoft.com/en-us/library/cc905758.aspx">prependOrgName(&#8221;)</a> which adds the organization prefix to the argument, if it is necessary. That means for an external request, it returns always the argument which you have passed.</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> IsExternalRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ifdTestValue <span style="color: #339933;">=</span> prependOrgName<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> isIFDCall <span style="color: #339933;">=</span> ifdTestValue <span style="color: #339933;">==</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">return</span> isIFDCall<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Calling <code>IsExternalRequest</code> will return true, if the request comes from an external network range. You could also define this function globally in the form context (see also <a
href="http://www.stunnware.com/crm2/topic.aspx?id=JS5">http://www.stunnware.com/crm2/topic.aspx?id=JS5</a>)</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;">IsExternalRequest <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ifdTestValue <span style="color: #339933;">=</span> prependOrgName<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> isIFDCall <span style="color: #339933;">=</span> ifdTestValue <span style="color: #339933;">==</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">return</span> isIFDCall<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://www.langalaxy.de/2010/05/howto-detect-external-request-with-javascript/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 299/319 objects using disk: basic

Served from: www.langalaxy.de @ 2012-02-07 02:57:37 -->
