<?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>crm.atechnisch.nl &#187; Javascript</title>
	<atom:link href="http://crm.atechnisch.nl/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://crm.atechnisch.nl</link>
	<description>How to improve Microsoft Dynamics CRM</description>
	<lastBuildDate>Wed, 25 Nov 2009 08:12:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use Tooltips as Hot Help</title>
		<link>http://crm.atechnisch.nl/2009/07/use-tooltips-as-hot-help/</link>
		<comments>http://crm.atechnisch.nl/2009/07/use-tooltips-as-hot-help/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 11:24:01 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 3.0 Application]]></category>
		<category><![CDATA[MS CRM 3.0 Customizations]]></category>
		<category><![CDATA[MS CRM 4.0 Application]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[label]]></category>
		<category><![CDATA[Microsoft Dynamics CRM 4.0]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/?p=137</guid>
		<description><![CDATA[There are multiple ways in MS Dynamics CRM (MS CRM) to help users using the system. Next to training and external guides, the system can also provide information. In the system the help files (on the top right of every screen) can be improved. As you will know this has advantages and disadvantages.
Another option is [...]]]></description>
			<content:encoded><![CDATA[<p>There are multiple ways in MS Dynamics CRM (MS CRM) to help users using the system. Next to training and external guides, the system can also provide information. In the system the help files (on the top right of every screen) can be improved. As you will know this has advantages and disadvantages.</p>
<p>Another option is to improve the tooltips.</p>
<p>The modifying and maintaining of the tooltips will be discussed in this post.</p>
<p>A tooltip is a small box, which contains a brief text message explaining the field. It appears below the label of a field on the MS CRM forms when the pointer of a mouse passes over or rests on that label and which contains a brief text message identifying or explaining the object. When the pointer moves away from the label the tooltip disappears.</p>
<p>Tooltips are available on every field on a MS CRM form. The current tooltips show the text of the label, which, in my opinion, does  not have any benefits. If you can read to label, you can read to tooltip. But the good thing is, we can change the contents of the current tooltips.</p>
<p>At the moment the only restrictions to the tooltips are that only unformatted text can be used and that the total amount of characters is no more than 512.</p>
<p>The onLoad code:</p>
<pre class="brush: plain;">

crmForm.all.new_attribute_c.title = “contents of the tooltip”
</pre>
<p>Example:</p>
<p><a href="http://crm.atechnisch.nl/crm_upload/2009/07/tooltip.gif" target="_blank"><img class="size-full wp-image-143 alignleft" title="tooltip" src="http://crm.atechnisch.nl/crm_upload/2009/07/tooltip.gif" alt="tooltip" width="231" height="96" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2009/07/use-tooltips-as-hot-help/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read-only fields on forms are not read-only</title>
		<link>http://crm.atechnisch.nl/2008/09/read-only-field-on-forms-are-not-read-only/</link>
		<comments>http://crm.atechnisch.nl/2008/09/read-only-field-on-forms-are-not-read-only/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 16:10:10 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 3.0 Application]]></category>
		<category><![CDATA[MS CRM 4.0 Application]]></category>
		<category><![CDATA[authorization]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[read-only]]></category>
		<category><![CDATA[rights]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/09/09/read-only-field-on-forms-are-not-read-only/</guid>
		<description><![CDATA[Fields in Ms Dynamics CRM cannot be set to read-only!!!
Ok, a little explanation and a demo script to show what I&#8217;m implying.
Yesterday a customer asked me to change the text in a read-only field. I&#8217;m system administrator on their system, so the easiest way should have been to change the Field Properties of the attribute, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Fields in Ms Dynamics CRM cannot be set to read-only!!!</strong><br />
Ok, a little explanation and a demo script to show what I&#8217;m implying.</p>
<p>Yesterday a customer asked me to change the text in a read-only field. I&#8217;m system administrator on their system, so the easiest way should have been to change the Field Properties of the attribute, but this would allow all users to change this attributes on all records.<br />
Another option would be to use the Enrich Functionality, described in this <a href="http://crm.atechnisch.nl/2008/08/07/enrich-data-via-data-management/" target="_blank">post</a>.</p>
<p>I tried a third option, triggering javascript via the Address Bar of Internet Explorer. The usage may be well know, but I never thought of using it to modify read-only fields on records. Well, it is surprisingly easy. All you need to know it the id of the attribute you want to modify. (The id can be found with something like the IE Developer Toolbar.)<br />
If you have the id the code is easy and you only have to copy it into the address bar of the record you want to modify:</p>
<pre class="brush: css;">
javascript:crmForm.all.new_attribute.DataValue = &quot;read-only doesn't work for me&quot;; crmForm.all.new_attribute.ForceSubmit = true; crmForm.Save();
</pre>
<p><strong>This means every user with modify rights on a record can change read-only field on that record.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/09/read-only-field-on-forms-are-not-read-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Publish Entity after creating Workflow</title>
		<link>http://crm.atechnisch.nl/2008/02/publish-entity-after-creating-workflow/</link>
		<comments>http://crm.atechnisch.nl/2008/02/publish-entity-after-creating-workflow/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 15:13:06 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 4.0 Application]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[Client Side Code]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Microsoft Dynamics CRM 4.0]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/02/15/publish-entity-after-creating-workflow/</guid>
		<description><![CDATA[I have noticed that after publishing a Workflow on an Entity, the custom Client Side Code on the Form of that Entity not always works before publishing the Entity again.
After publishing the Entity everything (including the Workflow) works fine.
]]></description>
			<content:encoded><![CDATA[<p>I have noticed that after publishing a Workflow on an Entity, the custom Client Side Code on the Form of that Entity not always works before publishing the Entity again.<br />
After publishing the Entity everything (including the Workflow) works fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/02/publish-entity-after-creating-workflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Global Variables in MS CRM 4.0</title>
		<link>http://crm.atechnisch.nl/2008/01/global-variables-in-ms-crm-40/</link>
		<comments>http://crm.atechnisch.nl/2008/01/global-variables-in-ms-crm-40/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 09:53:03 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[Global Variables]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[SDK]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/01/17/global-variables-in-ms-crm-40/</guid>
		<description><![CDATA[Global variables provide information about the Microsoft Dynamics CRM deployment and options chose by the user.
The following table shows the available global variables.Variable name and description
SERVER_URL: Provides a string that represents the base server URL. When a user is offline, the SERVER_URL points to the local Microsoft Dynamics CRM Web services.
USER_LANGUAGE_CODE: Provides an LCID value [...]]]></description>
			<content:encoded><![CDATA[<p>Global variables provide information about the Microsoft Dynamics CRM deployment and options chose by the user.<br />
The following table shows the available global variables.Variable name and description<br />
<strong>SERVER_URL</strong>: Provides a string that represents the base server URL. When a user is offline, the SERVER_URL points to the local Microsoft Dynamics CRM Web services.<br />
<strong>USER_LANGUAGE_CODE</strong>: Provides an LCID value representing the Microsoft Dynamics CRM Language Pack that the user has chosen<br />
<strong>ORG_LANGUAGE_CODE</strong>: Provides an LCID value representing the Microsoft Dynamics CRM Language Pack that is the base language for the organization<br />
<strong>ORG_UNIQUE_NAME</strong>: Provides the unique text value of the organizations name.</p>
<p>Example<br />
This script displays the values of these global variables.</p>
<pre class="brush: css;">
alert(&quot;SERVER_URL=&quot;+SERVER_URL );
alert(&quot;USER_LANGUAGE_CODE=&quot;+USER_LANGUAGE_CODE);
alert(&quot;ORG_LANGUAGE_CODE=&quot;+ORG_LANGUAGE_CODE);
alert(&quot;ORG_UNIQUE_NAME=&quot;+ORG_UNIQUE_NAME);
</pre>
<p>(Source SDK MS CRM 4.0)</p>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/01/global-variables-in-ms-crm-40/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stunnware JavaScript Code</title>
		<link>http://crm.atechnisch.nl/2008/01/stunnware-javascript-code/</link>
		<comments>http://crm.atechnisch.nl/2008/01/stunnware-javascript-code/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 15:08:15 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 3.0 Customizations]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[External Information]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Stunnware]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/01/16/stunnware-javascript-code/</guid>
		<description><![CDATA[Michael Höhne describes a lot of interesting things about MS CRM 3.0 and 4.0. It is mainly about scripting, and less about customizations. http://www.stunnware.com/crm2/
Below you will find a list with examples of javascript code you can find on the Stunnware page.
(Since I will not repeat his work, you have to go to his site).
More JavaScript [...]]]></description>
			<content:encoded><![CDATA[<p>Michael Höhne describes a lot of interesting things about MS CRM 3.0 and 4.0. It is mainly about scripting, and less about customizations. <a title="http://www.stunnware.com/crm2/" href="http://www.stunnware.com/crm2/" target="_blank">http://www.stunnware.com/crm2/</a><br />
Below you will find a list with examples of javascript code you can find on the Stunnware page.<br />
(Since I will not repeat his work, you have to go to his site).</p>
<p><a href="http://www.stunnware.com/crm2/topic.aspx?id=JS4" target="_blank">More JavaScript Code</a></p>
<p>Replacing the content of an IFRAME<br />
Adding additional values to duration fields<br />
Changing the title of a CRM form<br />
Changing the Link of a Ticker Symbol from MSN Money to Yahoo Finances<br />
Counting the number of backslashes in a string<br />
Changing the label of a field at runtime<br />
Changing the color of a single option in a picklist<br />
Opening a new window without the IE menu and status bars<br />
Retrieving the text of a lookup control<br />
Disabling a form at runtime<br />
Automatically changing the value of a text field to capitals<br />
Getting notified when the user selects a another tab on a form<br />
The current record id<br />
The current object type code<br />
Initializing a date field with the current date<br />
Changing the URL of an IFRAME at runtime<br />
Displaying a picture in a CRM form, using a text field to store the data source<br />
Changing the default lookup type<br />
Checking if a field is present in a form<br />
Calculating a date field based upon the selection of a picklist<br />
Creating a new email when double-clicking a standard text field<br />
Resetting a field value if validation fails<br />
Inserting line breaks in a text area control<br />
Hiding an entire row of a CRM form</p>
<p><a href="http://www.stunnware.com/crm2/topic.aspx?id=JS7" target="_blank">More JavaScript Code &#8211; Part 2</a></p>
<p>Disabling the time selection of a date/time field<br />
Changing the time interval in date/time fields<br />
Getting the quote id inside a quotedetail form<br />
How to know which button triggered the OnSave event<br />
Accessing the CRM database from JavaScript<br />
Modifying the Quick Create Form<br />
Forcing the selection of an account in the potential customer field of an opportunity<br />
Hiding and showing fields dynamically based on other field values<br />
Removing the value from a lookup field<br />
Hiding tabs at runtime<br />
Setting the active tab<br />
Displaying related entities instead of the form when opening a record<br />
Modifying the color of disabled form fields<br />
Removing a navigation bar entry at runtime<br />
Changing the color of a label</p>
<p><a href="http://www.stunnware.com/crm2/topic.aspx?id=JS12" target="_blank">More JavaScript Code &#8211; Part 3</a></p>
<p>Setting the background color of a CRM form<br />
Why can&#8217;t we use VBScript to write client-side code?<br />
Some calculated fields on the CRM form are not saved in the database<br />
Changing detailed tooltips when hovering over fields in a CRM form<br />
Fixing problems with orphaned OnChange event handlers<br />
Setting the field required level at runtime<br />
Setting a default time in a date field<br />
User interaction with yes/no style message boxes<br />
Testing if a lookup field has a value<br />
Comparing date values<br />
Getting notified when the user enters a form field<br />
Overriding the click event of a lookup field<br />
Formatting a date to YYYYMMDD<br />
The DataValue of a picklist is a string!<br />
Setting a picklist&#8217;s default value in code<br />
Starting an application from a CRM form<br />
Changing the available entity types in a lookup dialog<br />
Setting the text of the &#8220;Save As Completed&#8221; button<br />
Calculating durations<br />
Hiding a single field<br />
Setting a text field to the name of the entity referenced in a lookup control<br />
Getting notified when a user changes a checkbox value before leaving the field<br />
Preventing an OnChange event handler from executing when the form closes</p>
<p><a href="http://www.stunnware.com/crm2/topic.aspx?id=JS17" target="_blank">Client Side Scripting &#8211; More JavaScript Code &#8211; Part 4</a> </p>
<p>Maximizing a form<br />
Using a toolbar button to open a referenced entity<br />
Calculating the sum of two or more fields<br />
Calculating the total charge based on actural duration, hourly rate, trip charge and tax rate<br />
Changing error messages in CRM forms<br />
Setting a custom date field to another date minus 60 days<br />
Changing the default height of the lookup window<br />
Accessing the previous field value in OnChange<br />
Automatically calculate the tax value in an invoice line (invoicedetail)<br />
Performing an action when a CRM form closes<br />
Hooking into the &#8220;Lookup Address&#8221; feature in the order form<br />
Changing the form title (not the browser title)<br />
Passing parameters from a toolbar button to a CRM form<br />
Aborting an OnChange operation</p>
<p><a href="http://www.stunnware.com/crm2/topic.aspx?id=JS29" target="_blank">Client Side Scripting &#8211; More JavaScript Code &#8211; Part 5 </a></p>
<p>Formatting international phone numbers<br />
Rounding numerical fields<br />
Be aware of null values in Boolean fields<br />
Reusing code in OnLoad and OnChange event handlers<br />
Getting notified when the user selected an address in the address picker (quote, order, invoice)<br />
What is &#8220;if (condition) ? statement1 : statement2&#8243;?<br />
Copying the display name of a selected lookup value into a textbox<br />
Retrieving all fields inside a CRM form<br />
Knowing if you are running in CRM 3.0 or CRM 4.0<br />
Showing/Hiding tabs based on the selection in a picklist<br />
Changing the background color of a form (CRM 4.0)<br />
Calculating the difference of two numerical fields<br />
Disable all fields on a form<br />
When events do not fire anymore</p>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/01/stunnware-javascript-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiding link in navigation pane</title>
		<link>http://crm.atechnisch.nl/2008/01/hiding-link-in-navigation-pane/</link>
		<comments>http://crm.atechnisch.nl/2008/01/hiding-link-in-navigation-pane/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 10:42:24 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 3.0 Customizations]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[hide link]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[NavBar]]></category>
		<category><![CDATA[Navigation pane]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/01/16/hiding-link-in-navigation-pane/</guid>
		<description><![CDATA[How to hide a link to a related entity in the navigation pane of a form:
When you have a lookup on form (A) to an entity (B) you will have on form (B) a link to the related entities (A) in the navigation pane.
Sometimes you do not want to have the link to a related [...]]]></description>
			<content:encoded><![CDATA[<p>How to hide a link to a related entity in the navigation pane of a form:<br />
When you have a lookup on form (A) to an entity (B) you will have on form (B) a link to the related entities (A) in the navigation pane.<br />
Sometimes you do not want to have the link to a related entity (A) shown in the navigation pane of the form (B).<br />
To remove the link you can use a little piece of client side code put in the onLoad of the form (B):</p>
<pre class="brush: css;">
if (document.all.nav_new_form(B)_new_form(A) !=null)
{
document.all.nav_new_form(B)_new_form(A).style.display = &quot;none&quot;;
}
</pre>
<p>In version 4.0 hiding a link can also be done via out-of-the-box customization.</p>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/01/hiding-link-in-navigation-pane/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Related Entity in iFrame</title>
		<link>http://crm.atechnisch.nl/2008/01/related-entity-in-iframe/</link>
		<comments>http://crm.atechnisch.nl/2008/01/related-entity-in-iframe/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 10:36:01 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[iFrame]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[related entity]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/01/16/related-entity-in-iframe/</guid>
		<description><![CDATA[Related entities are not displayed directly on the form, but only via the navigation pane.
For the user this means an extra click, and more important, when they look at the form, they are not sure if a related record is present. One way to solve this is to show the associated view of the related [...]]]></description>
			<content:encoded><![CDATA[<p align="left">Related entities are not displayed directly on the form, but only via the navigation pane.<br />
For the user this means an extra click, and more important, when they look at the form, they are not sure if a related record is present. One way to solve this is to show the associated view of the related entity in an iFrame on the form. Related entities are not available as long as the entity has not been saved. Before the entity is saved the entity can not be shown in the iFrame.<br />
For this the script has to check if the related entity is available. This can be done by checking if the form has been saved. When the associated view of the related entity normally is shown in an iFrame the borders are the same as the borders of the normal associated view. This will cost you a lot of precious screen space. Via additional javascript lines the borders can be hidden.<br />
In MS CRM 4.0 you can have multiple organization on one server, this means we have to put the organization name in the link of the iFrame.<br />
The javascript code has to be placed in the onload of the entity</p>
<pre class="brush: css;">
//first check if the user is online. If the user is online, than the organization name should be used in the link. Otherwise (if offline) the organisation name should not be used in the link.
if (IsOnline())
{
var org = &quot;/&quot; + ORG_UNIQUE_NAME;
}
else
{
var org = &quot;&quot;;
}

//the first part is to hide the borders
var frameName = 'IFRAME_Name';
var objFrame = document.getElementById(frameName);
var objWindow = document.frames[frameName];
objFrame.allowTransparency=true;
objFrame.onreadystatechange = function () {
if (objWindow.document.readyState=='complete') {
objWindow.document.body.style.backgroundColor='transparent';
if (objWindow.document.getElementsByTagName('BODY')[0]!=null) {
objWindow.document.getElementsByTagName('BODY')[0].style.padding='0px';
}
if (objWindow.document.getElementsByTagName('TABLE')[0]!=null) {
objWindow.document.getElementsByTagName('TABLE')[0].cellPadding='0';
objWindow.document.getElementsByTagName('TABLE')[0].style.border='0px';
}
}
}

//setting the contents of the iframe
var navFrame2;
navFrame2 =
document.all.nav_new_new_entity_new_relatedentity;
var navWindow = document.frames['IFRAME_Name_d'];

//and checking if the entity has been saved, nor quick create, nor bulk edit
if (crmForm.FormType==1 || crmForm.FormType==5 || crmForm.FormType==6)
{
document.all.IFRAME_Name.src=&quot;about:blank&quot;;
}
else
{
if (navFrame2 != null)
{
document.all.IFRAME_Name.src= org + &quot;/userdefined/areas.aspx?oId=&quot; +
crmForm.ObjectId +&quot;&amp;amp;oType=&quot;+crmForm.ObjectTypeCode+&quot;&amp;amp;security=852023&amp;amp;tabSet=new_new_entity_new_relatedentity&quot;;
navFrame2.name = navFrame2.id;
}
else{
alert(&quot;Page Not Found&quot;);
}
}
</pre>
<p align="left"><strong>//PS Make sure the Security Setting &#8220;Restrict cross-frame scripting&#8221; is <span style="color: #ff0000;">NOT</span> enabled on the iFrame Properties form (the checkbox should be empty)  <br />
//AND you have to change the userdefined for system entities, but who is using does&#8230;</strong> (in the link of the parent entity you can find the solution e.g. something like &#8216;document.all.IFRAME_Name.src= org + &#8220;/sfa/opps/ &#8216; etc).</p>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/01/related-entity-in-iframe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copying lookup text to text field</title>
		<link>http://crm.atechnisch.nl/2008/01/copying-lookup-text-to-text-field/</link>
		<comments>http://crm.atechnisch.nl/2008/01/copying-lookup-text-to-text-field/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 10:17:50 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 3.0 Customizations]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Lookup]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/01/16/copying-lookup-text-to-text-field/</guid>
		<description><![CDATA[If you want to copy the value (text) of a lookup field to a text box, you can use this code below with a lookup field called &#8211; new_lookupid and a Text field (nvarchar or ntext) called &#8211; new_textfield

var lookup = crmForm.all.new_lookupid.DataValue;
if (lookup[0] !=null)
{
var theText = lookup[0].name;
}
crmForm.all.new_textfield.DataValue = (theText);
crmForm.all.new_textfield.ForceSubmit = true;

]]></description>
			<content:encoded><![CDATA[<p>If you want to copy the value (text) of a lookup field to a text box, you can use this code below with a lookup field called &#8211; new_lookupid and a Text field (nvarchar or ntext) called &#8211; new_textfield</p>
<pre class="brush: css;">
var lookup = crmForm.all.new_lookupid.DataValue;
if (lookup[0] !=null)
{
var theText = lookup[0].name;
}
crmForm.all.new_textfield.DataValue = (theText);
crmForm.all.new_textfield.ForceSubmit = true;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/01/copying-lookup-text-to-text-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide a complete section on a form</title>
		<link>http://crm.atechnisch.nl/2008/01/hide-a-complete-section-on-a-form/</link>
		<comments>http://crm.atechnisch.nl/2008/01/hide-a-complete-section-on-a-form/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 09:50:08 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 3.0 Customizations]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[Hide Section]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/01/16/hide-a-complete-section-on-a-form/</guid>
		<description><![CDATA[To hide a complete section on a form.
Choose one of the fields in the section (new_attribute) and use this code:

crmForm.all.new_attribute_c.parentElement.parentElement.parentElement.style.display = 'none'

To show the section again:

crmForm.all.new_attribute_c.parentElement.parentElement.parentElement.style.display = 'block'

]]></description>
			<content:encoded><![CDATA[<p align="left">To hide a complete section on a form.<br />
Choose one of the fields in the section (new_attribute) and use this code:</p>
<pre class="brush: css;">
crmForm.all.new_attribute_c.parentElement.parentElement.parentElement.style.display = 'none'
</pre>
<p align="left">To show the section again:</p>
<pre class="brush: css;">
crmForm.all.new_attribute_c.parentElement.parentElement.parentElement.style.display = 'block'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/01/hide-a-complete-section-on-a-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trigger onChange in Onload script</title>
		<link>http://crm.atechnisch.nl/2008/01/trigger-onchange-in-onload-script/</link>
		<comments>http://crm.atechnisch.nl/2008/01/trigger-onchange-in-onload-script/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 09:44:51 +0000</pubDate>
		<dc:creator>Huib Aarts</dc:creator>
				<category><![CDATA[Client Side Scripting]]></category>
		<category><![CDATA[MS CRM 3.0 Customizations]]></category>
		<category><![CDATA[MS CRM 4.0 Customizations]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OnChange]]></category>
		<category><![CDATA[OnLoad]]></category>

		<guid isPermaLink="false">http://crm.atechnisch.nl/2008/01/16/trigger-onchange-in-onload-script/</guid>
		<description><![CDATA[Sometimes when you use an onChange event, for example to enable and disabled fields, the change is not preserved when you reload the form.
This is logical because the condition is not checked in the onLoad script and, as you will know, enabling and disabling is not save with the form. (it is done client side)
You [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you use an onChange event, for example to enable and disabled fields, the change is not preserved when you reload the form.<br />
This is logical because the condition is not checked in the onLoad script and, as you will know, enabling and disabling is not save with the form. (it is done client side)<br />
You can prevent this by adding the same code to the onLoad script, but than you have to maintain the code in two different places.<br />
Another option is to trigger the onChange script in the onLoad script:<br />
<strong>crmForm.all.new_attribute.FireOnChange(); </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://crm.atechnisch.nl/2008/01/trigger-onchange-in-onload-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
