<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title></title>
	<atom:link href="http://rameshch.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rameshch.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 15 Jun 2009 15:36:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rameshch.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title></title>
		<link>http://rameshch.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rameshch.wordpress.com/osd.xml" title="" />
	<atom:link rel='hub' href='http://rameshch.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Creating a Local User on Windows 2003 server</title>
		<link>http://rameshch.wordpress.com/2009/06/15/creating-a-local-user-on-windows-2003-server/</link>
		<comments>http://rameshch.wordpress.com/2009/06/15/creating-a-local-user-on-windows-2003-server/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 15:36:47 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=119</guid>
		<description><![CDATA[Creating a Local User on Windows 2003 server 1. From the Windows Start menu select Administrative Tools &#124; Computer Management. If this menu item does not exist, you are either not an administrator for the computer or the server is a domain controller and you need to create a domain user instead. 2. From the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=119&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Creating a Local User on Windows 2003 server</p>
<p>   1. From the Windows Start menu select Administrative Tools | Computer Management. If this menu item does not exist, you are either not an administrator for the computer or the server is a domain controller and you need to create a domain user instead.<br />
   2. From the Computer Management dialog, navigate to System Tools | Local Users and Groups | Users on the left panel; right click on Users and select New user from the popup menu.<br />
   3. In the New User dialog, enter prtracker, PR-Tracker and Problem Tracking System for the User name, Full name and Description, respectively.<br />
   4. Uncheck box User must change password at next login and then check box Password Never Expires.<br />
   5. Click the Create button to create the user and then click Close button.<br />
   6. Optional steps follow: double-click the prtracker username on the right panel.<br />
   7. From the prtracker Properties dialog, select tab Member Of and click the Add button.<br />
   8. From the Select Groups dialog and in the Name box, type Administrators and click the OK button. Also, add prtracker user to be member of DCOM User Group.</p>
<p>Note that optional steps 6, 7 and 8 are only recommended if you plan to use SQL Server as your database provider. Even if you do plan to use SQL Server as the database provider, these steps are optional if you choose to configure the server roles in SQL Server instead.</p>
<p>   1. From the Windows Start menu select Administrative Tools | Active Directory Users and Computers. If this menu item does not exist, the server is not a domain controller and you should create a local user instead.<br />
   2. From the Active Directory Users and Computers dialog, navigate to Users on the left panel; right click on Users and select New | User from the popup menu.<br />
   3. In the New Object &#8211; User dialog, enter PR-Tracker and prtracker for the First name and User logon name, respectively.<br />
   4. In next dialog check box Password never expires.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=119&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/06/15/creating-a-local-user-on-windows-2003-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Create failed for Login &#8216;xxx&#8217;. (Microsoft.SqlServer.Express.Smo)</title>
		<link>http://rameshch.wordpress.com/2009/05/17/create-failed-for-login-xxx-microsoft-sqlserver-express-smo/</link>
		<comments>http://rameshch.wordpress.com/2009/05/17/create-failed-for-login-xxx-microsoft-sqlserver-express-smo/#comments</comments>
		<pubDate>Sun, 17 May 2009 07:47:42 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=117</guid>
		<description><![CDATA[I was trying to create a user with weak Login Name and password. Error message below shown. Create failed for Login &#8216;xxx&#8217;. (Microsoft.SqlServer.Express.Smo) ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo) The MUST_CHANGE option is not supported by this version of Microsoft Windows. (Microsoft SQL Server, Error: 15195) What i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=117&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was trying to create a user with weak Login Name and password. Error message below shown.</p>
<p>Create failed for Login &#8216;xxx&#8217;. (Microsoft.SqlServer.Express.Smo)<br />
ADDITIONAL INFORMATION:<br />
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)</p>
<p>The MUST_CHANGE option is not supported by this version of Microsoft Windows. (Microsoft SQL Server, Error: 15195)</p>
<p>What i do is uncheck the &#8220;Enforce password policy&#8221; when create the new user. This way you will not get the error message, but this is not the recommended way for the production Login Name and Password.</p>
<p>Problem solved. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=117&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/05/17/create-failed-for-login-xxx-microsoft-sqlserver-express-smo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Using built-in CRM functions when writing SQL Reports</title>
		<link>http://rameshch.wordpress.com/2009/02/27/using-built-in-crm-functions-when-writing-sql-reports/</link>
		<comments>http://rameshch.wordpress.com/2009/02/27/using-built-in-crm-functions-when-writing-sql-reports/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 07:26:27 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[CRM]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[bultin date functions]]></category>
		<category><![CDATA[Microsoft Dynamics]]></category>
		<category><![CDATA[reporting services]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=114</guid>
		<description><![CDATA[If you&#8217;ve ever worked with CRM&#8217;s Advanced Find you know what an amazing number of built-in date query parameters there are. It turns out, that those query parameters have corresponding user-defined SQL functions that you can use in your own queries for operations such as custom reports. Here is a list of some of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=114&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever worked with CRM&#8217;s Advanced Find you know what an amazing number of built-in date query parameters there are.  It turns out, that those query parameters have corresponding user-defined SQL functions that you can use in your own queries for operations such as custom reports.</p>
<p>Here is a list of some of the more common date functions:</p>
<p>fn_BeginOfDay<br />
fn_BeginOfHour<br />
fn_BeginOfLastMonth<br />
fn_BeginOfLastSevenDay<br />
fn_BeginOfLastWeek<br />
fn_BeginOfLastXDay<br />
fn_BeginOfLastXHour<br />
fn_BeginOfLastXWeek<br />
fn_BeginOfLastYear<br />
fn_BeginOfMonth<br />
fn_BeginOfNextMonth<br />
fn_BeginOfNextWeek<br />
fn_BeginOfNextYear<br />
fn_BeginOfThisMonth<br />
fn_BeginOfThisWeek<br />
fn_BeginOfThisYear<br />
fn_BeginOfToday<br />
fn_BeginOfTomorrow<br />
fn_BeginOfWeek<br />
fn_BeginOfYear<br />
fn_BeginOfYesterday<br />
fn_EndOfLastMonth<br />
fn_EndOfLastWeek<br />
fn_EndOfLastYear<br />
fn_EndOfNextMonth<br />
fn_EndOfNextSevenDay<br />
fn_EndOfNextWeek<br />
fn_EndOfNextXDay<br />
fn_EndOfNextXHour<br />
fn_EndOfNextXWeek<br />
fn_EndOfNextYear<br />
fn_EndOfThisMonth<br />
fn_EndOfThisWeek<br />
fn_EndOfThisYear<br />
fn_EndOfToday<br />
fn_EndOfTomorrow<br />
fn_EndOfYesterday<br />
fn_FirstDayOfMonth<br />
fn_LastXMonth<br />
fn_LastXYear<br />
fn_LocalTimeToUTC<br />
fn_NextXMonth<br />
fn_NextXYear<br />
fn_NTDayOfWeek</p>
<p>If you would like to see these functions in action, copy the following script into SQL Management Studio and run it ( after connecting to the CRM database ):</p>
<p>select &#8216;fn_BeginOfDay&#8217; as &#8220;Function&#8221;,  dbo.fn_BeginOfDay(GetDate()) as &#8220;Value&#8221;<br />
union<br />
select &#8216;fn_BeginOfHour&#8217;,  dbo.fn_BeginOfHour(GetDate())<br />
union<br />
select &#8216;fn_BeginOfLastMonth&#8217;,  dbo.fn_BeginOfLastMonth(GetDate())<br />
union<br />
select &#8216;fn_BeginOfLastSevenDay&#8217;,  dbo.fn_BeginOfLastSevenDay(GetDate())<br />
union<br />
select &#8216;fn_BeginOfLastWeek&#8217;,  dbo.fn_BeginOfLastWeek(GetDate())<br />
union<br />
select &#8216;fn_BeginOfLastXDay&#8217;,  dbo.fn_BeginOfLastXDay(GetDate(), 1)<br />
union<br />
select &#8216;fn_BeginOfLastXHour&#8217;,  dbo.fn_BeginOfLastXHour(GetDate(), 1)<br />
union<br />
select &#8216;fn_BeginOfLastXWeek&#8217;,  dbo.fn_BeginOfLastXWeek(GetDate(), 2)<br />
union<br />
select &#8216;fn_BeginOfLastYear&#8217;,  dbo.fn_BeginOfLastYear(GetDate())<br />
union<br />
select &#8216;fn_BeginOfMonth&#8217;,  dbo.fn_BeginOfMonth(GetDate())<br />
union<br />
select &#8216;fn_BeginOfNextMonth&#8217;,  dbo.fn_BeginOfNextMonth(GetDate())<br />
union<br />
select &#8216;fn_BeginOfNextWeek&#8217;,  dbo.fn_BeginOfNextWeek(GetDate())<br />
union<br />
select &#8216;fn_BeginOfNextYear&#8217;,  dbo.fn_BeginOfNextYear(GetDate())<br />
union<br />
select &#8216;fn_BeginOfThisMonth&#8217;,  dbo.fn_BeginOfThisMonth(GetDate())<br />
union<br />
select &#8216;fn_BeginOfThisWeek&#8217;,  dbo.fn_BeginOfThisWeek(GetDate())<br />
union<br />
select &#8216;fn_BeginOfThisYear&#8217;,  dbo.fn_BeginOfThisYear(GetDate())<br />
union<br />
select &#8216;fn_BeginOfToday&#8217;,  dbo.fn_BeginOfToday(GetDate())<br />
union<br />
select &#8216;fn_BeginOfTomorrow&#8217;,  dbo.fn_BeginOfTomorrow(GetDate())<br />
union<br />
select &#8216;fn_BeginOfWeek&#8217;,  dbo.fn_BeginOfWeek(GetDate())<br />
union<br />
select &#8216;fn_BeginOfYear&#8217;,  dbo.fn_BeginOfYear(GetDate())<br />
union<br />
select &#8216;fn_BeginOfYesterday&#8217;,  dbo.fn_BeginOfYesterday(GetDate())<br />
union<br />
select &#8216;fn_EndOfLastMonth&#8217;,  dbo.fn_EndOfLastMonth(GetDate())<br />
union<br />
select &#8216;fn_EndOfLastWeek&#8217;,  dbo.fn_EndOfLastWeek(GetDate())<br />
union<br />
select &#8216;fn_EndOfLastYear&#8217;,  dbo.fn_EndOfLastYear(GetDate())<br />
union<br />
select &#8216;fn_EndOfNextMonth&#8217;,  dbo.fn_EndOfNextMonth(GetDate())<br />
union<br />
select &#8216;fn_EndOfNextSevenDay&#8217;,  dbo.fn_EndOfNextSevenDay(GetDate())<br />
union<br />
select &#8216;fn_EndOfNextWeek&#8217;,  dbo.fn_EndOfNextWeek(GetDate())<br />
union<br />
select &#8216;fn_EndOfNextXDay&#8217;,  dbo.fn_EndOfNextXDay(GetDate(), 1)<br />
union<br />
select &#8216;fn_EndOfNextXHour&#8217;,  dbo.fn_EndOfNextXHour(GetDate(), 1)<br />
union<br />
select &#8216;fn_EndOfNextXWeek&#8217;,  dbo.fn_EndOfNextXWeek(GetDate(), 1)<br />
union<br />
select &#8216;fn_EndOfNextYear&#8217;,  dbo.fn_EndOfNextYear(GetDate())<br />
union<br />
select &#8216;fn_EndOfThisMonth&#8217;,  dbo.fn_EndOfThisMonth(GetDate())<br />
union<br />
select &#8216;fn_EndOfThisWeek&#8217;,  dbo.fn_EndOfThisWeek(GetDate())<br />
union<br />
select &#8216;fn_EndOfThisYear&#8217;,  dbo.fn_EndOfThisYear(GetDate())<br />
union<br />
select &#8216;fn_EndOfToday&#8217;,  dbo.fn_EndOfToday(GetDate())<br />
union<br />
select &#8216;fn_EndOfTomorrow&#8217;,  dbo.fn_EndOfTomorrow(GetDate())<br />
union<br />
select &#8216;fn_EndOfYesterday&#8217;,  dbo.fn_EndOfYesterday(GetDate())<br />
union<br />
select &#8216;fn_FirstDayOfMonth&#8217;,  dbo.fn_FirstDayOfMonth(GetDate(), 10)<br />
union<br />
select &#8216;fn_LastXMonth&#8217;,  dbo.fn_LastXMonth(GetDate(), 1)<br />
union<br />
select &#8216;fn_LastXYear&#8217;,  dbo.fn_LastXYear(GetDate(), 1)<br />
union<br />
select &#8216;fn_NextXMonth&#8217;,  dbo.fn_NextXMonth(GetDate(), 1)<br />
union<br />
select &#8216;fn_NextXYear&#8217;,  dbo.fn_NextXYear(GetDate(), 1) </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=114&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/02/27/using-built-in-crm-functions-when-writing-sql-reports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>How to change the default entity in Look UP window</title>
		<link>http://rameshch.wordpress.com/2009/02/27/here-we-go-add-following-line-in-onload-of-opportunity-entity-form-it-will-work-for-atleast-the-lookup-window/</link>
		<comments>http://rameshch.wordpress.com/2009/02/27/here-we-go-add-following-line-in-onload-of-opportunity-entity-form-it-will-work-for-atleast-the-lookup-window/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 07:14:24 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[CRM]]></category>
		<category><![CDATA[Microsoft Dynamics]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=112</guid>
		<description><![CDATA[For instance, in Opportunity form of Microsoft CRM you want to change the “Potential Customer” field’s default entity from Account to Contact. You need to use the following piece of code in onLoad event of the Opportunity Form. if ( crmForm.all.customerid != null ) { crmForm.all.customerid .setAttribute(”defaulttype”, “2″); } Remember to enable the event and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=112&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For instance, in Opportunity form of Microsoft CRM you want to change the “Potential Customer” field’s default entity from Account to Contact. You need to use the following piece of code in onLoad event of the Opportunity Form.</p>
<p>if ( crmForm.all.customerid != null )<br />
{<br />
    crmForm.all.customerid .setAttribute(”defaulttype”, “2″);<br />
}</p>
<p>Remember to enable the event and then save and publish the opportunity entity.</p>
<p> Following are codes of basic entities of Microsoft CRM 3 ;</p>
<p>    * Account    1<br />
    * Contact     2<br />
    * Lead         4</p>
<p>Here we go. Add following line in onLoad of opportunity entity form. It will work for atleast the lookup window.<br />
crmForm.all.customerid.setAttribute(”lookuptypes”, “1″);</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=112&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/02/27/here-we-go-add-following-line-in-onload-of-opportunity-entity-form-it-will-work-for-atleast-the-lookup-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Clearing a value from a DynamicEntity object</title>
		<link>http://rameshch.wordpress.com/2009/02/25/clearing-a-value-from-a-dynamicentity-object-2/</link>
		<comments>http://rameshch.wordpress.com/2009/02/25/clearing-a-value-from-a-dynamicentity-object-2/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 14:19:34 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[CRM]]></category>
		<category><![CDATA[MicrosoftDynamics]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=110</guid>
		<description><![CDATA[This was by no means something I discovered myself, Patrick Verbeeten suggested this as a solution to a problem I had in the forums. I thought it would be a good idea to pass on the information though. Lets say you have a DynamicEntity object and you need to clear one of the values in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=110&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This was by no means something I discovered myself, Patrick Verbeeten suggested this as a solution to a problem I had in the forums. I thought it would be a good idea to pass on the information though.</p>
<p>Lets say you have a DynamicEntity object and you need to clear one of the values in a plugin, for example the parentid of a contact. Normally, to add an attribute to a DynamicEntity you would use the entity.Properties.Add(&#8230;) method, but the problem is that CRM only processes values that has a value.</p>
<p>What I tried initially was to remove the value using the entity.Properties.Remove(attributename) method. This did delete the attribute, but on saving the DynamicEntity, it did not save this attribute to the server but instead left it the way it was.</p>
<p>What Patrick suggested was to use the null value coupled with each crm attribute type, example CrmDateTime.Null or CrmNumber.Null. So what I did was to add the null value to the PropertyBag and set the acctual value to null.</p>
<p>entity.Properties.Add(new CrmDateTimeProperty(CrmDateTime.Null));</p>
<p>What is very important here is that each attribute type has it&#8217;s own Null value, you cannot interchange CrmDateTime.Null and CrmNumber.Null.</p>
<p>The only exception to this seems to be a string type attribute, you only need to assign the value as an empty string &#8220;&#8221;. Note that you may also be able to use the String.Empty method, I have not tried this yes but would say that this should also work.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=110&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/02/25/clearing-a-value-from-a-dynamicentity-object-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Showing and hiding fields based on another field</title>
		<link>http://rameshch.wordpress.com/2009/02/25/showing-and-hiding-fields-based-on-another-field/</link>
		<comments>http://rameshch.wordpress.com/2009/02/25/showing-and-hiding-fields-based-on-another-field/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 14:17:07 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[CRM]]></category>
		<category><![CDATA[crm microsoft dynamics]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=108</guid>
		<description><![CDATA[This is not a new topic, but it does creep up in the forums from time to time. I thought it may be easier to write a blog entry on the topic. So here is the scenario, you have a picklist (or any other field) and you want to show and hide other fields based [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=108&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is not a new topic, but it does creep up in the forums from time to time. I thought it may be easier to write a blog entry on the topic.</p>
<p>So here is the scenario, you have a picklist (or any other field) and you want to show and hide other fields based on this. Let&#8217;s say your picklist field is called &#8220;mypicklist&#8221; and you have two other fields, one is a text field called &#8220;mytextfield&#8221; and one is a lookup called &#8220;mylookup&#8221;. The values in the picklist are &#8220;Show Text Field&#8221;, with a value of 1 and &#8220;Show Lookup Field&#8221; with a value of 2. You want to show/hide the fields accordingly.</p>
<p>Firstly you need to write the following code in the mypicklist onChange event:</p>
<p>if (crmForm.all.mypicklist.DataValue == 1) //show text field<br />
{<br />
//hide the lookup<br />
crmForm.all.mylookup.style.display = &#8216;none&#8217;;<br />
crmForm.all.mylookup_c.style.display = &#8216;none&#8217;; //note the _c<br />
crmForm.all.mylookup_d.style.display = &#8216;none&#8217;; //note the _d, only required for lookups</p>
<p>//show the text field<br />
crmForm.all.mytextfield.style.display = &#8216;inline&#8217;;<br />
crmForm.all.mytextfield_c.style.display = &#8216;inline&#8217;; //note the _c<br />
}<br />
else if (crmForm.all.mypicklist.DataValue == 2) //show loookup<br />
{<br />
//hide the lookup<br />
crmForm.all.mylookup.style.display = &#8216;inline&#8217;;<br />
crmForm.all.mylookup_c.style.display = &#8216;inline&#8217;; //note the _c<br />
crmForm.all.mylookup_d.style.display = &#8216;inline&#8217;; //note the _d, only required for lookups</p>
<p>//show the text field<br />
crmForm.all.mytextfield.style.display = &#8216;none&#8217;;<br />
crmForm.all.mytextfield_c.style.display = &#8216;none&#8217;; //note the _c<br />
}<br />
else // hide all<br />
{<br />
//hide the lookup crmForm.all.mylookup.style.display = &#8216;none&#8217;;<br />
crmForm.all.mylookup_c.style.display = &#8216;none&#8217;; //note the _c<br />
crmForm.all.mylookup_d.style.display = &#8216;none&#8217;; //note the _d, only required for lookups</p>
<p>//show the text field<br />
crmForm.all.mytextfield.style.display = &#8216;none&#8217;;<br />
crmForm.all.mytextfield_c.style.display = &#8216;none&#8217;; //note the _c<br />
}</p>
<p>As you can see, each field has two (three for lookups) sections that has to be hidden, the first section is identified by the field schema name and represents the textbox area. The second, represented by the fieldname following by an &#8220;_c&#8221; represents the label area. Lookups also has an additional area, replresented by the fieldname followed by an &#8220;_d&#8221; which represents the lookup button. Each of these sections needs to be shown/hidden individually.</p>
<p>The second part is ensuring these are hidden/shown after they are saved, so the exact same code above needs to be placed in the form load event too. It may also make your life easier to create a global function in the onload event and then call this function from both within the onload event and the picklist onchange event. Something like:</p>
<p>ShowHideField = function()<br />
{<br />
//all the above code goes in here<br />
}</p>
<p>// then call the above in both the onload and the relevent onchange event<br />
ShowHideField();</p>
<p>The above goes for most field types and you can also show or hide fields based on whether they contain data or not with the following:</p>
<p>if (crmForm.all.mypicklist.DataValue != null) //show text field<br />
{<br />
&#8230;<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=108&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/02/25/showing-and-hiding-fields-based-on-another-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Clearing a value from a DynamicEntity object</title>
		<link>http://rameshch.wordpress.com/2009/02/25/clearing-a-value-from-a-dynamicentity-object/</link>
		<comments>http://rameshch.wordpress.com/2009/02/25/clearing-a-value-from-a-dynamicentity-object/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 08:54:44 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[CRM]]></category>
		<category><![CDATA[MicrosoftDynamics]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/2009/02/25/clearing-a-value-from-a-dynamicentity-object/</guid>
		<description><![CDATA[This was by no means something I discovered myself, Patrick Verbeeten suggested this as a solution to a problem I had in the forums. I thought it would be a good idea to pass on the information though. Lets say you have a DynamicEntity object and you need to clear one of the values in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=107&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This was by no means something I discovered myself, Patrick Verbeeten suggested this as a solution to a problem I had in the forums. I thought it would be a good idea to pass on the information though.</p>
<p>Lets say you have a DynamicEntity object and you need to clear one of the values in a plugin, for example the parentid of a contact. Normally, to add an attribute to a DynamicEntity you would use the entity.Properties.Add(&#8230;) method, but the problem is that CRM only processes values that has a value.</p>
<p>What I tried initially was to remove the value using the entity.Properties.Remove(attributename) method. This did delete the attribute, but on saving the DynamicEntity, it did not save this attribute to the server but instead left it the way it was.</p>
<p>What Patrick suggested was to use the null value coupled with each crm attribute type, example CrmDateTime.Null or CrmNumber.Null. So what I did was to add the null value to the PropertyBag and set the acctual value to null.</p>
<p>entity.Properties.Add(new CrmDateTimeProperty(CrmDateTime.Null));</p>
<p>What is very important here is that each attribute type has it&#8217;s own Null value, you cannot interchange CrmDateTime.Null and CrmNumber.Null.</p>
<p>The only exception to this seems to be a string type attribute, you only need to assign the value as an empty string &#8220;&#8221;. Note that you may also be able to use the String.Empty method, I have not tried this yes but would say that this should also work.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=107&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/02/25/clearing-a-value-from-a-dynamicentity-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom Validator</title>
		<link>http://rameshch.wordpress.com/2009/02/20/custom-validator/</link>
		<comments>http://rameshch.wordpress.com/2009/02/20/custom-validator/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 11:07:27 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[Ajax and javaScript]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[custom validation]]></category>
		<category><![CDATA[java script]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=103</guid>
		<description><![CDATA[In this article, I discuss how to work with custom validator. Before writing this article, I tried to use custom validators many times and I failed every time. Now after reading an article http://www.codeproject.com/aspnet/MultiDependValidator.asp from codeproject site, I realized that what I was missing in my code.  The asp:CustomValidator tag looks like this : Server [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=103&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this article, I discuss how to work with custom validator. Before writing this article, I tried to use custom validators many times and I failed every time. Now after reading an article http://www.codeproject.com/aspnet/MultiDependValidator.asp from codeproject site, I realized that what I was missing in my code.</p>
<p> The asp:CustomValidator tag looks like this :</p>
<p>Server Side Validation:</p>
<p>Protected void FunctionToValidateAtServer(object sender, ServerValidateEventArgs e)</p>
<p>{ If (Controls are Valid) e.IsValid = true; else e.IsValid = false; }</p>
<p>Client Side validation:</p>
<p>Function JavaScriptValidationFunction(source, args)</p>
<p>{ If (controls are valid) e.IsValid = true; else args.IsValid = false; }</p>
<p>Till this I used to write the code. But what I used to miss is written below. So never forget to write this code when we write custom validators.</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left">&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left">&lt;!&#8211;</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left"><span>  </span><span class="GramE">ValidatorHookupControlID(</span>&#8220;&lt;%= controlTobeValidated1.ClientID %&gt;&#8221;,</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left"><span>     </span><span class="GramE">document.all[</span>"&lt;%= cutomValidatorToRespond.ClientID %&gt;"]);</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left"> </p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left"><span>  </span><span class="GramE">ValidatorHookupControlID(</span>&#8220;&lt;%=controlTobeValidated2.ClientID %&gt;&#8221;,</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left"><span>     </span><span class="GramE">document.all[</span>"&lt;%=cutomValidatorToRespond.ClientID %&gt;"]);</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left"><span>     </span>…</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left">//&#8211;&gt;</p>
<p class="MsoNormal" style="text-indent:0;line-height:normal;text-align:left;" align="left">&lt;/script&gt;</p>
<p> &lt;!&#8211;<br />
  ValidatorHookupControlID(&#8220;&#8221;, </p>
<p>     document.all[""]);</p>
<p>  ValidatorHookupControlID(&#8220;&#8221;, </p>
<p>     document.all[""]);</p>
<p>     …<br />
// &#8211;&gt;This is where the magic happens&#8230; This informs the built invalidation subroutines to update validation whenever one of these controls change. You can easily add as many controls as needed to a single validator&#8217;s dependencies. The ValidatorHookupControlID function is part of the standard Microsoft validation scripts.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=103&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/02/20/custom-validator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Using ICALLBACKEventHandler in ASP.NET</title>
		<link>http://rameshch.wordpress.com/2009/02/12/using-icallbackeventhandler-in-aspnet/</link>
		<comments>http://rameshch.wordpress.com/2009/02/12/using-icallbackeventhandler-in-aspnet/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 07:25:30 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[Ajax and javaScript]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[call back event]]></category>
		<category><![CDATA[java script asp.net c#]]></category>
		<category><![CDATA[server code]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=95</guid>
		<description><![CDATA[ASP.NET 2.0 introduced an interface named ICallbackEventHandler (System.Web.UI.ICallbackEventHandler) to allow asynchronous communication with the server. Unlike Postback, in Callback only user defined information is sent to the server. Instead of using Postback to post the page, ICallbackEventHandler uses the DoCallback event to send user defined data to server, and return a String to client; on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=95&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0 introduced an interface named ICallbackEventHandler (System.Web.UI.ICallbackEventHandler) to allow asynchronous communication with the server. Unlike Postback, in Callback only user defined information is sent to the server. Instead of using Postback to post the page, ICallbackEventHandler uses the DoCallback event to send user defined data to server, and return a String to client; on the client-side JavaScript can then manipulate the string. In total we have to use four functions for the implementating ICallbackEventHandler; two client side functions (in javascript) and two server side functions (C# in this case).</p>
<p>Use of ICallbackEventHandler:</p>
<p>To use ICallbackEventHandler, we will need to inherit it on the page or in a user control. The code will for this will be:</p>
<p>public partial class Default2 : System.Web.UI.Page,System.Web.UI.ICallbackEventHandler</p>
<p>As a result of inheriting from ICallbackEventHandler, we have to implement two functions, namely:</p>
<p>* public void RaiseCallbackEvent(String eventArgument)</p>
<p>* public String GetCallbackResult()</p>
<p>As name of the above two functions indicates, the first function gets called automatically whenever there is a CallbackEvent. After the first function the second function i.e. GetCallbackResult gets called and returns a string to the client</p>
<p>So how to raise a CallbackEvent? For this we will have to use javascript. There will be two javascript functions:</p>
<p>1. A function which will call RaiseCallbackEvent.</p>
<p>2. A function which will handle the response from the server. This function will be called automatically after GetCallbackResult() and the string returned by GetCallbackResult will appear in JavaScript as input to this function.</p>
<p>Implementing ICallbackEventHandler</p>
<p>1. Create an ASPX page as follows<br />
&lt;form id=&#8221;form1&#8243; runat=&#8221;server&#8221;&gt;<br />
&lt;div&gt;<br />
Select The Item and Click the Button<br />
&lt;asp:DropDownList ID=&#8221;DropDownList1&#8243; runat=&#8221;server&#8221;&gt;&lt;/asp:DropDownList&gt;<br />
&lt;br /&gt;<br />
&lt;br /&gt;<br />
&lt;button type=&#8221;Button&#8221; onclick=&#8221;CheckForTimeZone()&#8221;&gt;Get Timezone&lt;/button&gt;<br />
&lt;br /&gt;<br />
&lt;table&gt;&lt;tr&gt;<br />
&lt;td&gt;GMT Time zone is :&lt;/td&gt;<br />
&lt;td&gt;&lt;div id=&#8221;Results&#8221; runat=&#8221;server&#8221;&gt;&lt;/div&gt;&lt;/td&gt;<br />
&lt;/tr&gt;&lt;/table&gt;<br />
&lt;br /&gt;<br />
&lt;/div&gt;<br />
&lt;/form&gt;</p>
<p>In above code “CheckForTimeZone()” in the button tag is a javascript function which we will add later. Also note that the button is a simple HTML control.</p>
<p>2. JavaScript in the Aspx page.</p>
<p> &lt;script type=&#8221;text/ecmascript&#8221;&gt;</p>
<p>    function CheckForTimeZone()<br />
{<br />
var lb = document.getElementById(&#8220;DropDownList1&#8243;);<br />
var selectedItem = lb.options[lb.selectedIndex].text;<br />
CallServer(selectedItem, &#8220;&#8221;);<br />
}</p>
<p>function ReceiveServerData(retValue)<br />
{ <br />
document.getElementById(&#8220;Results&#8221;).innerHTML = retValue;<br />
}</p>
<p>  &lt;/script&gt;</p>
<p> </p>
<p> </p>
<p>In above code CallServer(selectedItem, &#8220;&#8221;) will be responsible for calling RaiseCallbackEvent on server side. And the ReceiveServerData(retValue) function gets called by GetCallbackResult().</p>
<p>To make above code work the way we want; we will need to add some code to the aspx.cs file.</p>
<p>3. Server-Side C# code (i.e. apsx.cs file)</p>
<p>public partial class Default2 : System.Web.UI.Page,System.Web.UI.ICallbackEventHandler</p>
<p>{</p>
<p>private static Hashtable hashTable;</p>
<p>protected String returnValue;</p>
<p>protected void Page_Load(object sender, EventArgs e)</p>
<p>{</p>
<p>if (!IsPostBack)</p>
<p>{</p>
<p>String cbReference =</p>
<p>Page.ClientScript.GetCallbackEventReference(this, &#8220;arg&#8221;, &#8220;ReceiveServerData&#8221;, &#8220;context&#8221;);</p>
<p>String callbackScript;</p>
<p>callbackScript = &#8220;function CallServer(arg, context)&#8221; +</p>
<p>&#8220;{ &#8221; + cbReference + &#8220;;}&#8221;;</p>
<p>Page.ClientScript.RegisterClientScriptBlock(this.GetType(),</p>
<p>&#8220;CallServer&#8221;, callbackScript, true);</p>
<p>hashTable = new Hashtable();</p>
<p>hashTable.Add(&#8220;Hawaii&#8221;, &#8220;GMT -10:00&#8243;);</p>
<p>hashTable.Add(&#8220;Central America&#8221;, &#8220;GMT -06:00&#8243;);</p>
<p>hashTable.Add(&#8220;Greenland&#8221;, &#8220;GMT -03:00&#8243;);</p>
<p>hashTable.Add(&#8220;Athens&#8221;, &#8220;GMT +02:00&#8243;);</p>
<p>DropDownList1.DataSource = hashTable;</p>
<p>DropDownList1.DataTextField = &#8220;key&#8221;; //If you say value Values from HashTable will be added to Drpdownlist</p>
<p>DropDownList1.DataBind();</p>
<p>}</p>
<p>}</p>
<p>In the above code, please note the following:</p>
<p>String cbReference = Page.ClientScript.GetCallbackEventReference(this, &#8220;arg&#8221;, &#8220;ReceiveServerData&#8221;, &#8220;context&#8221;);</p>
<p>If we debug the code “cbReference” it will contain “WebForm_DoCallback(&#8216;__Page&#8217;,arg,ReceiveServerData,context,null,false)</p>
<p>”; . Observe that the string, WebForm_DoCallback contains ReceiveServerData, it’s the javascript function we have written in step 2.</p>
<p>String callbackScript;</p>
<p>callbackScript = &#8220;function CallServer(arg, context)&#8221; + &#8220;{ &#8221; + cbReference + &#8220;;}&#8221;;</p>
<p>Again “callbackScript” will contain some string. Actually it is a JavaScript function which we will register to the client page. Using</p>
<p>Page.ClientScript.RegisterClientScriptBlock(this.GetType(),&#8221;CallServer&#8221;, callbackScript, true);</p>
<p>This registers our CallServer function on the page. We are essentially passing the selected item of the Dropdown list to the CallServer function if you see the source code of the output page the CallServer function will appear as follows:</p>
<p>This CallServer function is responsible for raising the callbackEvent ( i.e. RaiseCallbackEvent(String eventArgument) ) and the “arg” will be the eventArgument.</p>
<p>4. Finally add RaisecallbackEvent and GetCallbackResult.</p>
<p>Add following code to aspx.cs file</p>
<p>public void RaiseCallbackEvent(String eventArgument)</p>
<p>{</p>
<p>if (hashTable[eventArgument] == null)</p>
<p>{</p>
<p>returnValue = &#8220;-1&#8243;;</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>returnValue = hashTable[eventArgument].ToString();</p>
<p>}</p>
<p>}</p>
<p>public String GetCallbackResult()</p>
<p>{</p>
<p>return returnValue;</p>
<p>}</p>
<p>The above code provides the basic plumbing to implement asynchronous callbacks using ICALLBACKEventHandler. In subsequent articles we will extend this to real world applications and develop an AJAX-enabled GridView control.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=95&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/02/12/using-icallbackeventhandler-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Redirct  browser to  back with history</title>
		<link>http://rameshch.wordpress.com/2009/02/03/redirct-browser-to-back-with-history/</link>
		<comments>http://rameshch.wordpress.com/2009/02/03/redirct-browser-to-back-with-history/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 11:49:41 +0000</pubDate>
		<dc:creator>rameshch</dc:creator>
				<category><![CDATA[Ajax and javaScript]]></category>
		<category><![CDATA[broswer]]></category>
		<category><![CDATA[java script]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[respond.redirect]]></category>

		<guid isPermaLink="false">http://rameshch.wordpress.com/?p=93</guid>
		<description><![CDATA[I have a page &#8220;one&#8221; with a button using Response.Redirect(&#8220;pagetwo.asxp&#8221;) to go to the next page. On page two I have a button using Response.Redirect(&#8220;pageone.aspx&#8221;) to go back to page one. When I view page one, select some information, then go to page two, and then select the back button (using the response.redirect) none of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=93&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a page &#8220;one&#8221; with a button using Response.Redirect(&#8220;pagetwo.asxp&#8221;) to<br />
go to the next page.</p>
<p>On page two I have a button using Response.Redirect(&#8220;pageone.aspx&#8221;) to go<br />
back to page one.</p>
<p>When I view page one, select some information, then go to page two, and then<br />
select the back button (using the response.redirect) none of my selections<br />
remain. If I just use the back button of the web <a id="KonaLink0" class="kLink" href="http://www.velocityreviews.com/forums/t63166-how-to-use-responseredirct-like-a-browser-back-button.html#" target="undefined"><span style="font-weight:400;font-size:13px;color:#0000ff;position:static;"><span class="kLink" style="font-weight:400;font-size:13px;color:blue!important;font-family:arial,verdana,geneva,lucida,&quot;position:static;">browser</span></span></a> everything works<br />
fine.</p>
<p>To get it to work like the back button, Instead of using Response.Redirect<br />
to go back to page one you could execute some client side <a id="KonaLink1" class="kLink" href="http://www.velocityreviews.com/forums/t63166-how-to-use-responseredirct-like-a-browser-back-button.html#" target="undefined"><span style="font-weight:400;font-size:13px;color:#0000ff;position:static;"><span class="kLink" style="font-weight:400;font-size:13px;color:blue!important;font-family:arial,verdana,geneva,lucida,&quot;position:static;">javascript</span></span></a> like<br />
this:<br />
history.go(-1);</p>
<p>So you could have a &#8220;Back&#8221; anchor tag in your <a id="KonaLink2" class="kLink" href="http://www.velocityreviews.com/forums/t63166-how-to-use-responseredirct-like-a-browser-back-button.html#" target="undefined"><span style="font-weight:400;font-size:13px;color:#0000ff;position:static;"><span class="kLink" style="font-weight:400;font-size:13px;color:blue!important;font-family:arial,verdana,geneva,lucida,&quot;position:static;">HTML</span></span></a> that looks like this:<br />
&lt;a href=&#8217;javascript<strong></strong>:history.go(-1);&#8217;&gt;Back&lt;/a&gt;</p>
<p>Here&#8217;s more info:<br />
<a rel="nofollow" href="http://www.devguru.com/Technologies/ecmascript/quickref/history_go.html" target="_blank">http://www.devguru.com/Technologies/&#8230;istory_go.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rameshch.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rameshch.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rameshch.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rameshch.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rameshch.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rameshch.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rameshch.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rameshch.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rameshch.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rameshch.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rameshch.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rameshch.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rameshch.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rameshch.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rameshch.wordpress.com&amp;blog=3836483&amp;post=93&amp;subd=rameshch&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rameshch.wordpress.com/2009/02/03/redirct-browser-to-back-with-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/bc167fe9eb653cc47ef565d5cea23e4c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ramesh</media:title>
		</media:content>
	</item>
	</channel>
</rss>
