<?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>Comity Designs</title>
	<atom:link href="http://comitydesigns.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://comitydesigns.com</link>
	<description></description>
	<lastBuildDate>Thu, 22 Mar 2012 17:25:29 +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>Patch Org for Managed Package</title>
		<link>http://comitydesigns.com/blog/patch-org-for-managed-package/</link>
		<comments>http://comitydesigns.com/blog/patch-org-for-managed-package/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 06:35:31 +0000</pubDate>
		<dc:creator>vishal</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Tech Talk]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=1210</guid>
		<description><![CDATA[Patch Org Upgrade In order to create a patch org, the user will have to click on the new button as shown below: Patch Org view On Click of New, following screen is displayed: Create Patch Org View Select the Version number, enter appropriate username for the patch org and make sure that the email [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><strong>Patch Org Upgrade</strong></p>
<p>In order to create a patch org, the user will have to click on the new button as shown below:</p>
<p align="center"><img class="attachment-medium" src="http://comitydesigns.com/wordpress/wp-content/uploads/2012/01/Patch13-300x168.png" alt="Patch1" width="300" height="168" /></p>
<p align="center">Patch Org view</p>
<p>On Click of New, following screen is displayed:</p>
<p><img class="attachment-medium aligncenter" src="http://comitydesigns.com/wordpress/wp-content/uploads/2012/01/Patch2.png" alt="Patch2" width="300" height="168" /></p>
<p align="center">Create Patch Org View</p>
<p>Select the Version number, enter appropriate username for the patch org and make sure that the email address is correct for patch dev org.</p>
<p align="center"><img class="attachment-medium" src="http://comitydesigns.com/wordpress/wp-content/uploads/2012/01/Patch3-300x168.png" alt="Patch3" width="300" height="168" /></p>
<p align="center">Selected Patch Org created</p>
<ol>
<li>Once the patch is created by retrieving all the latest code, the user will have to log into the patch org to make any code changes.</li>
<li>Once the changes are made within the patch org, the user can upload the package as he/she would do in the managed dev org.</li>
</ol>
<div><img class="attachment-medium aligncenter" src="http://comitydesigns.com/wordpress/wp-content/uploads/2012/01/Patch4-300x168.png" alt="Patch4" width="300" height="168" /></div>
<p align="center">Push Upgrade and Version view</p>
<p>The Version tab shows the version that was uploaded in the patch org, the admin can then click on the Push Upgrade button.</p>
<p><img class="attachment-medium aligncenter" src="http://comitydesigns.com/wordpress/wp-content/uploads/2012/01/Patch5-300x168.png" alt="Patch5" width="300" height="168" /></p>
<p align="center">Push Upgrade Screen</p>
<p>On push upgrade screen, click on the Schedule Push Upgrade button:</p>
<p><img class="attachment-medium aligncenter" src="http://comitydesigns.com/wordpress/wp-content/uploads/2012/01/Patch6-300x168.png" alt="Patch6" width="300" height="168" /></p>
<p align="center">Schedule Push Upgrade Screen</p>
<p>Within the Schedule Push Upgrade Screen, the admin can select the Patch Version, if there are any orgs that does not have the version of code uploaded it will show up in the Select Target Organizations grid.</p>
<p>The admin is able to schedule those selected organization and apply the patch version 1.2.2.</p>
<p><img class="attachment-medium aligncenter" src="http://comitydesigns.com/wordpress/wp-content/uploads/2012/01/Patch7-300x168.png" alt="Patch7" width="300" height="168" /></p>
<p style="text-align: center">Upload result screen</p>
<p>Upload results will be displayed on the Push Upgrade Screen, the targets have a hyper link that shows more details about the scheduled tasks.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/patch-org-for-managed-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OAuth 2.0 for provisioning Users and communicating with Salesforce</title>
		<link>http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/</link>
		<comments>http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 02:16:44 +0000</pubDate>
		<dc:creator>vishal</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=1104</guid>
		<description><![CDATA[Recently I came across a client who wanted to provision the Salesforce user on their system, the criteria was to allow the target system to push data from their end without the use of Salesforce Session Id. This problem was unique such that the target system does not have any username password stored in their [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I came across a client who wanted to provision the Salesforce user on their system, the criteria was to allow the target system to push data from their end without the use of Salesforce Session Id.  This problem was unique such that the target system does not have any username password stored in their system so the problem requires some thought.  I decided that I will create a POC that will allow the target system to be able to talk to Salesforce.  One point to note here is that the target system has to be from a trusted organization and should require user’s approval.</p>
<p>The first thing that people would discuss is to make use of SSO, this my colleague Vilas have blogged earlier.  I on another hand have taken another approach that to make use of Oauth 2.0 on Force.com it involves making use of Remote Access functionality.  I will go through the exact steps to establish the initial handshake and thereby have target application push data to Salesforce.  The target application will be written in C#.</p>
<p>The first step here is to set up the Remote Access, I have covered the Consumer Key but an entry here will provide a Consumer Key and Consumer Secret.</p>
<p>Step 1</p>
<p>Navigate to<br />
Setup -&gt; App Setup -&gt; Remote Access</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Remote-Access-Setup.png"><img class="aligncenter size-full wp-image-1106" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Remote-Access-Setup.png" alt="" width="624" height="175" /></a></p>
<p style="text-align: center"><strong><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Remote-Access-Setup.png"></a>Remote Access Setup</strong></p>
<p>Step 2<br />
I then went ahead and created a Visual Force page called Admin Screen:</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Buttons.png"></a><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Buttons.png"><img class="aligncenter size-full wp-image-1114" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Buttons.png" alt="" width="632" height="106" /></a></p>
<p>Here I have created two different buttons, one that will open a separate window using javascript and another that will open a tab and make use of the PageReference, both performing similar functionality.</p>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Admin-Screen.png"><img class="aligncenter size-full wp-image-1112" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Admin-Screen.png" alt="" width="623" height="332" /></a><strong>Visual Force Page for the Admin Screen</strong></p>
<p>Step 3</p>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Admin-Screen-Controller.png"><img class="aligncenter size-full wp-image-1108" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Admin-Screen-Controller.png" alt="" width="624" height="332" /></a><strong>Admin Screen Controller</strong></p>
<p>The code reference above provides two links, one that calls VisitConcur, on Click of that button the url will include isNewUser=true and sessionId is passed to the target website.</p>
<p>I have inserted a breakpoint where the session id is captured, and if it is a newUser, the GetRefreshToken(); function is called, this will inadvertently ask the user to insert the Salesforce username/password:</p>
<p>Step 4</p>
<p>Target Web site</p>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Target-Website.png"></a><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Target-Website.png"><img class="aligncenter size-full wp-image-1115" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Target-Website.png" alt="" width="629" height="281" /></a><span style="color: #000000"><strong>Target Website (written in C#)</strong></span></p>
<p>Step 5</p>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Insertion-Of-Salesforce-Username_Password.png"><img class="aligncenter size-full wp-image-1116" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Insertion-Of-Salesforce-Username_Password.png" alt="" width="624" height="369" /></a></p>
<p style="text-align: center"><strong>Insertion of Salesforce Username/Password</strong></p>
<p>On insertion of Salesforce username/password, the user will be prompted to the user to all the target application to be trusted:</p>
<p>Step 6</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/User-prompted-to-trust-the-target-website.png"><img class="aligncenter size-full wp-image-1117" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/User-prompted-to-trust-the-target-website.png" alt="" width="625" height="263" /></a></p>
<p style="text-align: center"><strong>User prompted to trust the target website</strong></p>
<p>Once the user clicks on Allow will send the control back to the Target website and this time the call back script that I have created will have the access and refresh token that will allow the target application to push data to Salesforce:</p>
<p>Step 8</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Access-Refresh-Token.png"></a><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Access-Refresh-Token1.png"><img class="aligncenter size-full wp-image-1119" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Access-Refresh-Token1.png" alt="" width="232" height="191" /></a></p>
<p style="text-align: center"><strong>Access / Refresh Token</strong></p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Access-Refresh-Token-in-Debug-Mode.png"><img class="aligncenter size-full wp-image-1120" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Access-Refresh-Token-in-Debug-Mode.png" alt="" width="623" height="84" /></a></p>
<p style="text-align: center"><strong>Access / Refresh Token in Debug Mode</strong></p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Target-Website-ASPX-page.png"><img class="aligncenter size-full wp-image-1121" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Target-Website-ASPX-page.png" alt="" width="619" height="267" /></a></p>
<p style="text-align: center"><strong>Target Website ASPX page</strong></p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Call-back-script-in-code-behind.png"><img class="aligncenter size-full wp-image-1122" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Call-back-script-in-code-behind.png" alt="" width="609" height="137" /></a></p>
<p style="text-align: center"><strong>Call back script in code behind</strong></p>
<p>Onload of the page, the javascript function CallServer is called passing in the url that contains the access and refresh token and its context (i.e. alert in this case).<br />
Step 9</p>
<p>Now that we have the access and refresh token retrieved, we can make use of the access token to make API calls to Salesforce and retrieve or push data to Salesforce under the user’s credentials:</p>
<p>The URI here can be concatenated with token.instance_url + &#8220;/services/data/v20.0/query” and then we create a soql query to retrieve opportunities or any other object within Salesforce.</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Post-or-Get-information-from-Salesforce.png"><img class="aligncenter size-full wp-image-1123" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Post-or-Get-information-from-Salesforce.png" alt="" width="432" height="235" /></a></p>
<p style="text-align: center"><strong>Post or Get information from Salesforce</strong></p>
<p>Step 10</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Refresh-Token-to-retrieve-access-token.png"><img class="aligncenter size-full wp-image-1124" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Refresh-Token-to-retrieve-access-token.png" alt="" width="624" height="428" /></a></p>
<p style="text-align: center"><strong>Refresh Token to retrieve access token</strong></p>
<p>Finally there is one more point to note here, if the access token expires we can make use of the old refresh token to get a new access token without the user having to enter their username and password again. Instead of passing the access code we pass the refresh token, and pass the grant type as refreshToken instead of authorization_code. The function will return the new access token that we can make use of to communicate with Salesforce.</p>
<p>For more information visit:</p>
<p>http://wiki.developerforce.com/index.php/Digging_Deeper_into_OAuth_2.0_on_Force.com</p>

<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/target-website/' title='Target Website'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Target-Website-150x150.png" class="attachment-thumbnail" alt="Target Website" title="Target Website" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/insertion-of-salesforce-username_password/' title='Insertion Of Salesforce Username_Password'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Insertion-Of-Salesforce-Username_Password-150x150.png" class="attachment-thumbnail" alt="Insertion Of Salesforce Username_Password" title="Insertion Of Salesforce Username_Password" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/user-prompted-to-trust-the-target-website/' title='User prompted to trust the target website'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/User-prompted-to-trust-the-target-website-150x150.png" class="attachment-thumbnail" alt="User prompted to trust the target website" title="User prompted to trust the target website" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/access-refresh-token/' title='Access Refresh Token'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Access-Refresh-Token-150x150.png" class="attachment-thumbnail" alt="Access Refresh Token" title="Access Refresh Token" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/access-refresh-token-2/' title='Access Refresh Token'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Access-Refresh-Token1-150x150.png" class="attachment-thumbnail" alt="Access Refresh Token" title="Access Refresh Token" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/access-refresh-token-in-debug-mode/' title='Access Refresh Token in Debug Mode'><img width="150" height="84" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Access-Refresh-Token-in-Debug-Mode-150x84.png" class="attachment-thumbnail" alt="Access Refresh Token in Debug Mode" title="Access Refresh Token in Debug Mode" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/target-website-aspx-page/' title='Target Website ASPX page'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Target-Website-ASPX-page-150x150.png" class="attachment-thumbnail" alt="Target Website ASPX page" title="Target Website ASPX page" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/call-back-script-in-code-behind/' title='Call back script in code behind'><img width="150" height="137" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Call-back-script-in-code-behind-150x137.png" class="attachment-thumbnail" alt="Call back script in code behind" title="Call back script in code behind" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/post-or-get-information-from-salesforce/' title='Post or Get information from Salesforce'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Post-or-Get-information-from-Salesforce-150x150.png" class="attachment-thumbnail" alt="Post or Get information from Salesforce" title="Post or Get information from Salesforce" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/refresh-token-to-retrieve-access-token/' title='Refresh Token to retrieve access token'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Refresh-Token-to-retrieve-access-token-150x150.png" class="attachment-thumbnail" alt="Refresh Token to retrieve access token" title="Refresh Token to retrieve access token" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/remote-access-setup/' title='Remote Access Setup'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Remote-Access-Setup-150x150.png" class="attachment-thumbnail" alt="Remote Access Setup" title="Remote Access Setup" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/buttons/' title='Buttons'><img width="150" height="106" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Buttons-150x106.png" class="attachment-thumbnail" alt="Buttons" title="Buttons" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/admin-screen/' title='Admin Screen'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Admin-Screen-150x150.png" class="attachment-thumbnail" alt="Admin Screen" title="Admin Screen" /></a>
<a href='http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/attachment/admin-screen-controller/' title='Admin Screen Controller'><img width="150" height="150" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/12/Admin-Screen-Controller-150x150.png" class="attachment-thumbnail" alt="Admin Screen Controller" title="Admin Screen Controller" /></a>

]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/oauth-2-0-for-provisioning-users-on-external-web-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integration of Salesforce.com lookup field functionality with ExtJS</title>
		<link>http://comitydesigns.com/blog/integration-of-salesforce-com-lookup-field-functionality-with-extjs/</link>
		<comments>http://comitydesigns.com/blog/integration-of-salesforce-com-lookup-field-functionality-with-extjs/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 22:01:59 +0000</pubDate>
		<dc:creator>Rashi</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=1035</guid>
		<description><![CDATA[Blog entry posted for: Ivan Melnikov .. Overview ExtJS javascript framework is becoming more and more popular among web site developers because of its simplicity and support of the most popular browsers in industry. Salesforce.com platform is not an exception. The newer 4th version of ExtJS can be utilized to enrich standard VisualForce functionality with [...]]]></description>
			<content:encoded><![CDATA[<p class="Section1">
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;">
<h4><span style="font-weight: normal;"><em>Blog entry posted for</em>: Ivan Melnikov</span></h4>
<p>..</p>
<h4>Overview</h4>
<p>ExtJS javascript framework is becoming more and more popular among web site developers because of its simplicity and support of the most popular browsers in industry. Salesforce.com platform is not an exception. The newer 4<sup>th</sup> version of ExtJS can be utilized to enrich standard VisualForce functionality with flexible UI components and make data representation a lot more customizable.</p>
<p>However there are some custom tricks and hacks that have to be used to integrate standard Salesforce.com with ExtJS framework. In this article I’ll try to briefly explain how to integrate lookup fields with Ext buttons and use standard Salesforce popup window for searching records and adding them to the UI components on the page.</p>
<p><span id="more-1035"></span></p>
<h4>Implementation steps</h4>
<ul>
<li>You will need a lookup field on your page. This lookup field is going to be used to show the popup window only. It is not necessary to create any records using this field. Let’s create a custom object Lookup_Object__c and one lookup field to User object and name it User__c.</li>
<li>Create a controller class for the page. This class has to have “global” access modifier and implement standard controller because we’ll need to use remote action methods for asynchronous calls on this page.</li>
<li>Then define a remote action method which would return User record information by its Id in JSON format. For doing so we utilize new class available from the Winter’12 release for serialization of Salesforce.com objects into JSON format.</li>
</ul>
<p>Here is what we should get:</p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span lang="EN-US"><span lang="EN-US"> </span></span></p>
<p><strong>global</strong> <strong>with</strong> <strong>sharing</strong> <strong>class </strong>UserManagerController</p>
<p>{</p>
<p style="padding-left: 30px;"><strong>public </strong>UserManagerController(){}</p>
<p style="padding-left: 30px;"><strong>public </strong>UserManagerController(ApexPages.StandardController controller){}</p>
<p style="padding-left: 30px;">/* Object used to populate reference to user */</p>
<p style="padding-left: 30px;"><strong>public</strong> Lookup_Object__c lookupObject</p>
<p style="padding-left: 30px;">{</p>
<p style="padding-left: 60px;">get;</p>
<p style="padding-left: 60px;"><strong>set</strong>;</p>
<p style="padding-left: 30px;">}</p>
<p style="padding-left: 30px;">@RemoteAction</p>
<p style="padding-left: 30px;"><strong>global</strong> <strong>static </strong>String getUserData(String recordId)</p>
<p style="padding-left: 30px;">{</p>
<p style="padding-left: 60px;">List&lt;User&gt; user = [<strong>select</strong> FirstName, LastName, Title, CompanyName <strong>from</strong> User <strong>where</strong> Id = : recordId];</p>
<p style="padding-left: 60px;">// These methods are for serializing  Apex objects into JSON format available since Winter&#8217;12 release</p>
<p style="padding-left: 60px;">// Find out more at http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_json.htm</p>
<p style="padding-left: 60px;">String JSONString = JSON.serialize(user);</p>
<p style="padding-left: 60px;">//Depends on your needs and way you want to format your result. Lets just hardcode the status value for now.</p>
<p style="padding-left: 60px;"><strong>return</strong> &#8216;{&#8220;Records&#8221;:&#8217; +JSONString+&#8217;, &#8220;error&#8221;: &#8220;null&#8221;, &#8220;status&#8221;:&#8221;SUCCESS&#8221;}&#8217;;</p>
<p style="padding-left: 30px;">}</p>
<p>}</p>
<ul>
<li>Now create a VisualForce page. The lookup field should be hidden on the page. For doing that place it into the div under the form with style=&#8221;opacity:0; height:0;overflow:hidden;&#8221;. Please notice that we don’t use style=&#8221;display:none&#8221; in this case because it won&#8217;t work.</li>
<li>So if you inspect this hidden field we created you may notice that in fact it is div which contains multiple fields ending with “_lkid”, “_lkold”, “_mod” to which we’ll need to get access to, read UserId from the “_lkid”  and reset all of them afterwards.  In order to open search window programmatically we’ll need to change window.location to the url stored at href property of hidden field.</li>
<li>That is a basic concept. Please take a look at the code with comments inline. It is pretty straight forward and you can use it right away for you project needs.</li>
</ul>
<p>VisualForce page code:</p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span lang="EN-US"><span lang="EN-US">&lt;</span><span lang="EN-US">apex</span><span lang="EN-US">:</span><span lang="EN-US">page</span><span lang="EN-US"> <span style="color: black;">controller</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;UserManagerController&#8221;</span><span style="color: #5c5c5c;">&gt;</span></span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US">// Connects ExtJS library hosted at Sencha&#8217;s servers. However it can be stored locally as static resource.</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US">&lt;</span><span lang="EN-US">script</span><span lang="EN-US"> <span style="color: black;">type</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;text/javascript&#8221; </span><span style="color: black;">charset</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;utf-8&#8243;</span> <span style="color: black;">src</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;http://cdn.sencha.io/ext-4.0.7-gpl/ext-all.js&#8221;</span><span style="color: #5c5c5c;">&gt;&lt;/</span><span style="color: black;">script</span><span style="color: #5c5c5c;">&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US">&lt;</span><span lang="EN-US">link</span><span lang="EN-US"> <span style="color: black;">rel</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;stylesheet&#8221; </span><span style="color: black;">type</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;text/</span></span><span lang="EN-US">css</span><span lang="EN-US">&#8220;</span><span lang="EN-US"> <span style="color: black;">href</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;http://cdn.sencha.io/ext-4.0.7-gpl/resources/</span></span><span lang="EN-US">css</span><span lang="EN-US">/ext-all.</span><span lang="EN-US">css</span><span lang="EN-US">&#8220;</span><span lang="EN-US"> <span style="color: #5c5c5c;">/&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US">// Hidden form which contains lookup field to make standard salesforce lookup window work.</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US">&lt;</span><span lang="EN-US">apex</span><span lang="EN-US">:</span><span lang="EN-US">form</span><span lang="EN-US"> <span style="color: #5c5c5c;">&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: #5c5c5c;">&lt;</span><span style="color: black;">div</span> <span style="color: black;">style</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;opacity:0;height:0;overflow:hidden;&#8221;</span><span style="color: #5c5c5c;">&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">&lt;</span><span style="color: black;">apex</span><span style="color: #5c5c5c;">:</span><span style="color: black;">inputField</span> <span style="color: black;">id</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;userFieldId&#8221;</span> <span style="color: black;">value</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;{!lookupObject.User__c}&#8221;</span><span style="color: #5c5c5c;">/&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: #5c5c5c;">&lt;/</span><span style="color: black;">div</span><span style="color: #5c5c5c;">&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: #5c5c5c;">&lt;</span><span style="color: black;">div</span> <span style="color: black;">id</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;pageView&#8221;</span><span style="color: #5c5c5c;">&gt;&lt;/</span><span style="color: black;">div</span><span style="color: #5c5c5c;">&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US">&lt;/</span><span lang="EN-US">apex</span><span lang="EN-US">:</span><span lang="EN-US">form</span><span lang="EN-US">&gt;</span><span lang="EN-US"><br />
</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US">// Here is fun part begins&#8230;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US">&lt;</span><span lang="EN-US">script</span><span lang="EN-US"> <span style="color: black;">type</span><span style="color: #5c5c5c;">=</span><span style="color: #005c00;">&#8220;text/javascript&#8221;</span><span style="color: #5c5c5c;">&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">require</span><span style="color: #5c5c5c;">([ </span></span><span style="color: #005c00;">'Ext.form.*'</span><span style="color: #5c5c5c;">,</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #005c00;">'Ext.grid.*'</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #005c00;">'Ext.data.*'</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: #5c5c5c;">]);</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> <span style="color: green;">//Defines custom user model for the store</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">define</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8216;UserModel&#8217;</span><span style="color: #5c5c5c;">,</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">extend </span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">&#8216;Ext.data.Model&#8217;</span><span style="color: #5c5c5c;">,</span> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">fields</span><span style="color: #5c5c5c;">:</span> <span style="color: #5c5c5c;">[{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">name</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'LastName'</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">type</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'string'</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span> <span style="color: #5c5c5c;">{</span> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">name</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'FirstName'</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">type</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'string'</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span> <span style="color: #5c5c5c;">{</span> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">name</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'Title'</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">type</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'string'</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">name</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'CompanyName'</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">type</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'string'</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">]</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: #5c5c5c;">});</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: green;">// Defines custom user button which can be used multiple times</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">define</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8216;Ext.ux.UserButton&#8217;</span><span style="color: #5c5c5c;">,</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">alias</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">&#8216;widget.userButton&#8217;</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">extend</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">&#8216;Ext.button.Button&#8217;</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: green;">// Handler function fires every time user clicks on the button.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">handler</span> <span style="color: #5c5c5c;">:</span> <strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">()</span> <span style="color: #5c5c5c;">{</span> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">window</span><span style="color: #5c5c5c;">.</span><span style="color: black;">location</span> <span style="color: #5c5c5c;">=</span> <strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">uA</span><span style="color: #5c5c5c;">.</span><span style="color: black;">getAttribute</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8220;href&#8221;</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">initComponent </span><span style="color: #5c5c5c;">:</span> <strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">()</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var</span></strong> <span style="color: black;">me</span> <span style="color: #5c5c5c;">=</span> <strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var</span></strong> <span style="color: black;">uField</span> <span style="color: #5c5c5c;">=</span> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">get</span><span style="color: #5c5c5c;">(</span><span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">DomQuery</span><span style="color: #5c5c5c;">.</span><span style="color: black;">selectNode</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8220;input[id$=:userFieldId]&#8220;</span><span style="color: #5c5c5c;">));</span> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">me</span><span style="color: #5c5c5c;">.</span><span style="color: black;">uId</span> <span style="color: #5c5c5c;">=</span> <span style="color: black;">uField</span><span style="color: #5c5c5c;">.</span><span style="color: black;">getAttribute</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8220;id&#8221;</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">me</span><span style="color: #5c5c5c;">.</span><span style="color: black;">uA</span> <span style="color: #5c5c5c;">=</span> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">get</span><span style="color: #5c5c5c;">(</span><span style="color: black;">me</span><span style="color: #5c5c5c;">.</span><span style="color: black;">uId</span><span style="color: #5c5c5c;">+</span><span style="color: #005c00;">&#8216;_lkwgt&#8217;</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: green;">// Add on change event to the Salesforce user field. </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">uField</span><span style="color: #5c5c5c;">.</span><span style="color: black;">on</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8216;change&#8217;</span><span style="color: #5c5c5c;">,</span> <strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">()</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: green;">// There is some delay required to let script set values to fields. </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">Function</span><span style="color: #5c5c5c;">.</span><span style="color: black;">defer</span><span style="color: #5c5c5c;">(</span><strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">(){</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var</span></strong> <span style="color: black;">nValue</span> <span style="color: #5c5c5c;">=</span> <span style="color: black;">me</span><span style="color: #5c5c5c;">.</span><span style="color: black;">getFieldValue</span><span style="color: #5c5c5c;">();</span> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">if</span></strong> <span style="color: #5c5c5c;">(</span><span style="color: black;">nValue</span> <span style="color: #5c5c5c;">!=</span> <span style="color: #005c00;">&#8217;000000000000000&#8242;</span><span style="color: #5c5c5c;">)</span><br />
<span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 180px;"><span lang="EN-US"> <span style="color: black;">me</span><span style="color: #5c5c5c;">.</span><span style="color: black;">addUserToStore</span><span style="color: #5c5c5c;">(</span><span style="color: black;">nValue</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span> <span style="color: #004080;">10</span><span style="color: #5c5c5c;">,</span> <strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: #5c5c5c;">});</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">callParent</span><span style="color: #5c5c5c;">();</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: green;">// Returns value from the Salesforce user field</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">getFieldValue</span><span style="color: #5c5c5c;">:</span> <strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">()</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var</span></strong> <span style="color: black;">v</span> <span style="color: #5c5c5c;">=</span> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">get</span><span style="color: #5c5c5c;">(</span><strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">uId</span><span style="color: #5c5c5c;">+</span><span style="color: #005c00;">&#8220;_lkid&#8221;</span><span style="color: #5c5c5c;">).</span><span style="color: black;">getValue</span><span style="color: #5c5c5c;">();</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">return</span></strong> <span style="color: black;">v</span><span style="color: #5c5c5c;">!=</span><span style="color: #005c00;">&#8220;000000000000000&#8243;</span><span style="color: #5c5c5c;">?</span><span style="color: black;">v</span><span style="color: #5c5c5c;">:</span><span style="color: #005c00;">&#8220;&#8221;</span><span style="color: #5c5c5c;">;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: green;">// Removes all values from hidden fields related to Salesforce user field</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">resetFieldValue</span><span style="color: #5c5c5c;">:</span> <strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">()</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">get</span><span style="color: #5c5c5c;">(</span><strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">uId</span><span style="color: #5c5c5c;">).</span><span style="color: black;">dom</span><span style="color: #5c5c5c;">.</span><span style="color: black;">value</span> <span style="color: #5c5c5c;">=</span> <span style="color: #005c00;">&#8221;</span><span style="color: #5c5c5c;">;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">get</span><span style="color: #5c5c5c;">(</span><strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">uId</span><span style="color: #5c5c5c;">+</span><span style="color: #005c00;">&#8220;_lkid&#8221;</span><span style="color: #5c5c5c;">).</span><span style="color: black;">dom</span><span style="color: #5c5c5c;">.</span><span style="color: black;">value</span> <span style="color: #5c5c5c;">=</span> <span style="color: #005c00;">&#8217;000000000000000&#8242;</span><span style="color: #5c5c5c;">;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">get</span><span style="color: #5c5c5c;">(</span><strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">uId</span><span style="color: #5c5c5c;">+</span><span style="color: #005c00;">&#8220;_lkold&#8221;</span><span style="color: #5c5c5c;">).</span><span style="color: black;">dom</span><span style="color: #5c5c5c;">.</span><span style="color: black;">value</span> <span style="color: #5c5c5c;">=</span> <span style="color: #005c00;">&#8216;null&#8217;</span><span style="color: #5c5c5c;">;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">get</span><span style="color: #5c5c5c;">(</span><strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">uId</span><span style="color: #5c5c5c;">+</span><span style="color: #005c00;">&#8220;_mod&#8221;</span><span style="color: #5c5c5c;">).</span><span style="color: black;">dom</span><span style="color: #5c5c5c;">.</span><span style="color: black;">value</span> <span style="color: #5c5c5c;">=</span> <span style="color: #004080;">0</span><span style="color: #5c5c5c;">;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: green;">// Adds user to the Grid store</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">addUserToStore</span> <span style="color: #5c5c5c;">:</span> <strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">(</span><span style="color: black;">recordId</span><span style="color: #5c5c5c;">)</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var</span></strong> <span style="color: black;">grid</span> <span style="color: #5c5c5c;">=</span> <strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">up</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8220;grid&#8221;</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">grid</span><span style="color: #5c5c5c;">.</span><span style="color: black;">setLoading</span><span style="color: #5c5c5c;">(</span><span style="color: #800040;">true</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: green;">// Get data from SalesForce </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: green;">// Heres is apex remote action call, which allows user make request to APEX controller using Javascript. </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">UserManagerController</span><span style="color: #5c5c5c;">.</span><span style="color: black;">getUserData</span><span style="color: #5c5c5c;">(</span><span style="color: black;">recordId</span><span style="color: #5c5c5c;">,</span> <strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">(</span><span style="color: black;">result</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">er</span><span style="color: #5c5c5c;">){</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: green;">// Set loading mask on the grid.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: black;">grid</span><span style="color: #5c5c5c;">.</span><span style="color: black;">setLoading</span><span style="color: #5c5c5c;">(</span><span style="color: #800040;">false</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: green;">// Decode JSON string returned from the server.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var</span></strong> <span style="color: black;">res</span> <span style="color: #5c5c5c;">=</span> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">decode</span><span style="color: #5c5c5c;">(</span><span style="color: black;">result</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: green;">// If result field &#8220;status&#8221; contains word &#8221;SUCCESS&#8221; then proceed with adding new user on the grid. </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: green;">// Otherwise display popup with an error message.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">if</span></strong> <span style="color: #5c5c5c;">(</span><span style="color: black;">res</span> <span style="color: #5c5c5c;">&amp;&amp;</span> <span style="color: black;">res</span><span style="color: #5c5c5c;">.</span><span style="color: black;">status</span> <span style="color: #5c5c5c;">==</span> <span style="color: #005c00;">&#8220;SUCCESS&#8221;</span><span style="color: #5c5c5c;">)</span><br />
<span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <span style="color: green;">// Take first and only record returned from the server. There might be multiple ones, depending on design requirements.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var</span></strong> <span style="color: black;">userRec</span> <span style="color: #5c5c5c;">=</span> <span style="color: black;">res</span><span style="color: #5c5c5c;">.</span><span style="color: black;">Records</span><span style="color: #5c5c5c;">[</span><span style="color: #004080;">0</span><span style="color: #5c5c5c;">];</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <span style="color: green;">// Add record to the grid store</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <span style="color: black;">grid</span><span style="color: #5c5c5c;">.</span><span style="color: black;">store</span><span style="color: #5c5c5c;">.</span><span style="color: black;">add</span><span style="color: #5c5c5c;">(</span><span style="color: black;">userRec</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/11/ExtJS_integration_users_added.png"><img class="alignleft size-medium wp-image-1033" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/11/ExtJS_integration_users_added-300x159.png" alt="" width="300" height="159" /></a></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"><span style="color: #5c5c5c;">}</span> <strong><span style="color: #0000c0;">else</span></strong> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <span style="color: green;">// Display error message.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><span lang="EN-US"> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">Msg</span><span style="color: #5c5c5c;">.</span><span style="color: black;">alert</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8220;Error&#8221;</span><span style="color: #5c5c5c;">,</span><span style="color: #005c00;">&#8220;An unexpected error occurred.&#8221;</span><span style="color: #5c5c5c;">);</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 150px;"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/11/ExtJS_integration_users_error.png"><img class="alignleft size-medium wp-image-1034" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/11/ExtJS_integration_users_error-300x107.png" alt="" width="300" height="107" /></a></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span style="color: #5c5c5c;">}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: green;">// This parameter is used to prevent auto escaping of special characters like &amp;,@, quotes, double quotes etc.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: black;">escape</span><span style="color: #5c5c5c;">:</span> <span style="color: #800040;">false</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: #5c5c5c;">});</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: green;">// Reset user field values for the next click.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">this</span></strong><span style="color: #5c5c5c;">.</span><span style="color: black;">resetFieldValue</span><span style="color: #5c5c5c;">();</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: #5c5c5c;">});</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: green;">// Create an instance of grid.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var </span></strong><span style="color: black;">grid</span> <span style="color: #5c5c5c;">=</span> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">create</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8216;Ext.grid.Panel&#8217;</span><span style="color: #5c5c5c;">,</span><br />
<span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: green;">// tbar is toolbar element on the top of the grid. </span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">tbar</span> <span style="color: #5c5c5c;">:</span> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">create</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8216;Ext.toolbar.Toolbar&#8217;</span><span style="color: #5c5c5c;">,</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: green;">// Creates one button in tbar</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">items</span><span style="color: #5c5c5c;">:</span> <span style="color: #5c5c5c;">[{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">xtype</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'userButton'</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">text</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'Add User'</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}]</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}),</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: green;">// Creates store to keep user record for displaying on the grid.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: black;">store</span> <span style="color: #5c5c5c;">:</span> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">create</span><span style="color: #5c5c5c;">(</span><span style="color: #005c00;">&#8216;Ext.data.Store&#8217;</span><span style="color: #5c5c5c;">,</span><br />
<span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">model</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">&#8216;UserModel&#8217;</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">proxy</span> <span style="color: #5c5c5c;">:</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">type</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">&#8216;memory&#8217;</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">reader</span> <span style="color: #5c5c5c;">:</span> <span style="color: #5c5c5c;">{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <span style="color: black;">type</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">&#8216;json&#8217;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">data</span><span style="color: #5c5c5c;">:</span> <span style="color: #5c5c5c;">[]</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}),</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: green;">// Columns describe how records will be rendered on the grid.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <span style="color: black;">columns</span><span style="color: #5c5c5c;">:</span> <span style="color: #5c5c5c;">[</span></span><span style="color: #5c5c5c;">{</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">text</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">"Title"</span><span style="color: #5c5c5c;">,</span><br />
<span style="color: black;">width</span><span style="color: #5c5c5c;">:</span> <span style="color: #004080;">100</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">dataIndex</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'Title'</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">sortable</span><span style="color: #5c5c5c;">:</span> <span style="color: #800040;">true</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">text</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">"Name"</span><span style="color: #5c5c5c;">,</span><br />
<span style="color: black;">width</span><span style="color: #5c5c5c;">:</span> <span style="color: #004080;">200</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">dataIndex</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'Title'</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">sortable</span><span style="color: #5c5c5c;">:</span> <span style="color: #800040;">true</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">renderer</span><span style="color: #5c5c5c;">:</span> <strong><span style="color: #0000c0;">function</span></strong><span style="color: #5c5c5c;">(</span><span style="color: black;">value</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">p</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">record</span><span style="color: #5c5c5c;">){</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 120px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">return</span></strong> <span style="color: black;">record</span><span style="color: #5c5c5c;">.</span><span style="color: black;">data</span><span style="color: #5c5c5c;">.</span><span style="color: black;">LastName</span> <span style="color: #5c5c5c;">+</span> <span style="color: #005c00;">', '</span> <span style="color: #5c5c5c;">+</span> <span style="color: black;">record</span><span style="color: #5c5c5c;">.</span><span style="color: black;">data</span><span style="color: #5c5c5c;">.</span><span style="color: black;">FirstName</span> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">},{</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: black;">text</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">"Company"</span><span style="color: #5c5c5c;">, </span><span style="color: black;">width</span><span style="color: #5c5c5c;">:</span> <span style="color: #004080;">100</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">dataIndex</span><span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">'CompanyName'</span><span style="color: #5c5c5c;">,</span> <span style="color: black;">sortable</span><span style="color: #5c5c5c;">:</span> <span style="color: #800040;">true</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: #5c5c5c;">}</span></span><span style="color: #5c5c5c;">]</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> <span style="color: #5c5c5c;">});</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> <span style="color: green;">// Main panel contains grid panel and may potentially contain more panels in it. Renders to the &#8216;pageView&#8217;</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span lang="EN-US"> <span style="color: green;">// div tag, which we defined on the top of this page.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span lang="EN-US"> <strong><span style="color: #0000c0;">var </span></strong><span style="color: black;">mainPanel</span> <span style="color: #5c5c5c;">=</span><span style="color: #5c5c5c;"> </span><strong><span style="color: #0000c0;">new</span></strong> <span style="color: black;">Ext</span><span style="color: #5c5c5c;">.</span><span style="color: black;">panel</span><span style="color: #5c5c5c;">.</span><span style="color: black;">Panel</span><span style="color: #5c5c5c;">({</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">border</span><span style="color: #5c5c5c;">:</span> <span style="color: #800040;">false</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">renderTo</span> <span style="color: #5c5c5c;">:</span> <span style="color: #005c00;">&#8216;pageView&#8217;</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">width</span><span style="color: #5c5c5c;">:</span> <span style="color: #004080;">400</span><span style="color: #5c5c5c;">,</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span lang="EN-US"> <span style="color: black;">items</span> <span style="color: #5c5c5c;">:</span> <span style="color: #5c5c5c;">[</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> <span style="color: green;">// Only one panel, which is grid panel will be displayed on this parent panel.</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 90px;"><span lang="EN-US"> </span><span>grid</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 60px;"><span> <span style="color: #5c5c5c;">]</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; padding-left: 30px;"><span> <span style="color: #5c5c5c;">});</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"><span>&lt;/</span><span>script</span><span>&gt;</span><span> </span></p>
<p class="MsoNormal"><span>&lt;/</span><span>apex</span><span>:</span><span>page</span><span>&gt;</span></p>
<h4>What is good about it?</h4>
<p>ExtJs can significantly extend any VisualForce functionality and add new features which Salesforce doesn&#8217;t have yet. All developers need is to customize and embed some standard functionality with custom JavaSript code.</p>
<p>Thank you for reading!</p>
<p>**</p>
<p>If you want to test out the sample from the post, please find below a link to the unmanaged package:</p>
<p><a href="https://login.salesforce.com/packaging/installPackage.apexp?p0=04tU0000000DZd3" target="_blank">https://login.salesforce.com/packaging/installPackage.apexp?p0=04tU0000000DZd3</a></p>
<p>**</p>
<p class="MsoNormal">
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/integration-of-salesforce-com-lookup-field-functionality-with-extjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dreamforce 2011 : A spectacular event!!!</title>
		<link>http://comitydesigns.com/blog/dreamforce-2011-a-spectacular-event/</link>
		<comments>http://comitydesigns.com/blog/dreamforce-2011-a-spectacular-event/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 06:18:47 +0000</pubDate>
		<dc:creator>Rashi</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=1010</guid>
		<description><![CDATA[Dreamforce 2011 was a phenomenal event for Comity Designs, partners and clients! The event is always jam packed with conversations, building relationships, networking, and not to forget &#8211; having a little bit of fun in the mix of it all (as can be seen in the picture above). I also want to congratulate Comity Team [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/09/Comity-Booth_Glasses2.jpg"><img class="alignleft size-full wp-image-1012" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/09/Comity-Booth_Glasses2.jpg" alt="" width="640" height="478" /></a></p>
<p><strong>Dreamforce 2011</strong> was a <em>phenomenal </em>event for <strong>Comity Designs</strong>, <em>partners </em>and <em>clients</em>! The event is always jam packed with conversations, building relationships, networking, and not to forget &#8211; having a little bit of fun in the mix of it all (as can be seen in the picture above).</p>
<p>I also want to congratulate Comity Team members that once again this year have <strong>WON</strong> an award at the <strong>Dreamforce 2011 Hackathon</strong>!!!</p>
<p>**CHEERS**</p>
<p>And for all you visitors that are reading our blog, please check out the links below to read all about our announced victory.</p>
<p><strong>Hackathon Entry</strong>: &#8220;<em>Enterprise Mood Monitor&#8221;</em></p>
<p><a href="http://blogs.developerforce.com/developer-relations/2011/09/dreamforce-11-hackathon-winners-announced.html?utm_source=twitterfeed&amp;utm_medium=twitter&amp;utm_campaign=Feed%3A+SforceBlog+%28Force.com+Blog%29">Link 1</a> - Dreamforce ’11 Hackathon Winners Announced (Developer Force Blog)</p>
<p><a href="http://blogs.developerforce.com/guest/2011/09/19/hacker%E2%80%99s-digest-first-in-a-series/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+SforceBlog+%28Force.com+Blog%29">Link 2</a> - Social Media “Mood” App Wins Big at Dreamforce ’11 Hackathon (Developer Force Blog)</p>
<p><a href="http://blog.gnip.com/dreamforce-hackathon-winner-enterprise-mood-monitor/">Link 3</a> - Dreamforce Hackathon Winner: Enterprise Mood Monitor (GNIP Blog)</p>
<p>&#8230;</p>
<p>We will be sharing additional information about the hackathon and adding more pictures to our blog , so stay tuned and visit us again soon.</p>
<p>*****************************</p>
<p><strong>Pictures:</strong></p>
<p>*****************************</p>
<p><strong>Comity winning at the Dreamforce 2011 Hackathon</strong></p>
<p><strong>Participants</strong><em>: Shamil Arsunukayev, Ivan Melnikov, Gaziz Tazhenov</em></p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/09/DF2011-Hackathon-Presenting.jpg"><img class="alignleft size-full wp-image-1021" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/09/DF2011-Hackathon-Presenting.jpg" alt="" width="640" height="477" /></a></p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/09/DF2011-Hackathon-Winning.jpg"><img class="alignleft size-full wp-image-1022" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/09/DF2011-Hackathon-Winning.jpg" alt="" width="640" height="477" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/dreamforce-2011-a-spectacular-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to &#8211; Translation Workbench in Salesforce.com</title>
		<link>http://comitydesigns.com/blog/how-to-translation-workbench-in-salesforce-com/</link>
		<comments>http://comitydesigns.com/blog/how-to-translation-workbench-in-salesforce-com/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 17:48:00 +0000</pubDate>
		<dc:creator>vilas</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=963</guid>
		<description><![CDATA[Salesforce.com provides Translation Workbench, a feature that can be turned on only by calling in Customer Support or logging a Case through your Org. When the translation workbench feature is available, you have to login to your org and enable the feature, add new languages that you want to support and then provide translations for the areas of your application that you control.]]></description>
			<content:encoded><![CDATA[<p><strong>Overview</strong></p>
<p>Salesforce.com provides Translation Workbench, a feature that can be turned on only by calling in Customer Support or logging a Case through your Org. When the translation workbench feature is available, you have to login to your org and enable the feature, add new languages that you want to support and then provide translations for the areas of your application that you control.</p>
<p><strong>Steps to enable Translation Workbench</strong></p>
<ol>
<li>Call Salesforce.com support or enter a case to activate a feature [this feature is non-reversible after it is turned on].</li>
<li>When the customer support turns it on, login to your org and Enable the feature by going to Setup -&gt; Translation Workbench</li>
<li>Add languages that you want to support for you application</li>
<li>Provide translation</li>
<li>Update your code to use the translations if you haven’t already done designed for globalization</li>
</ol>
<p>At what level the translations can be turned on?</p>
<ol>
<li>Org level by going into Setup -&gt; Company Information -&gt; Edit [Default Language]</li>
<li>User level by going into Setup -&gt; Manage Users -&gt; Edit User [Language]</li>
</ol>
<p>However, keep in mind changing the Default Language at org level doesn’t change every user’s default language. In order for user to start seeing the content in different language, either of two things need to happen:</p>
<ul>
<li>Admin has to set the language at user level</li>
<li>User should use a browser with the locale for the language they want to see in Salesforce.com</li>
</ul>
<p>What gets translated?</p>
<p>Salesforce.com documentation mentions three main areas that get translated or need to be addressed either by Salesforce.com or by yourself in your own customizations [code or admin changes]</p>
<ol>
<li>Main salesforce.com application content [this is your standard look and feel of salesforce.com, standard objects and their labels]</li>
<li>Online help provided by Salesforce.com</li>
<li>Your own customizations – things like labels for your custom objects/fields properties, Visualforce page content that you control, picklist values you control.</li>
</ol>
<p><strong>Very Simple Example to illustrate the implementation</strong></p>
<p>Let’s make sure we have performed following steps before we start:</p>
<ol>
<li>The feature has been activated by Salesforce.com customer support</li>
<li>You have logged in to the Salesforce.com org and Enabled the feature [even though customer service activates the feature you still have to turn it on by going to Setup -&gt; Translation Workbench</li>
<li>Add Spanish language as the new language we are going to support in our Salesforce.com Org and make sure you have checked the Active check box.</li>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/Setup_TranslationMenu.png"><img class="alignnone size-full wp-image-968" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/Setup_TranslationMenu.png" alt="" width="214" height="130" /></a></p>
<p style="text-align: center">
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/TranslationBench_AddLanguage11.png"><img class="size-full wp-image-971 aligncenter" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/TranslationBench_AddLanguage11.png" alt="" width="787" height="200" /></a></p>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/TranslationBench_AddLanguage2.png"><img class="size-full wp-image-970 aligncenter" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/TranslationBench_AddLanguage2.png" alt="" width="792" height="202" /></a></p>
<p style="text-align: center">
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/TranslationBench_AddLanguage3.png"><img class="size-full wp-image-976 aligncenter" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/TranslationBench_AddLanguage3.png" alt="" width="322" height="329" /></a></p>
<li>Create a new Custom label named Field1Label to use in our Visualforce page. Set the value for it as “Value”. Also, add a spanish language translation for this custom label and set its value to to be “Valor”</li>
</ol>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/CreateLabel.png"><img class="aligncenter size-full wp-image-985" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/CreateLabel.png" alt="" width="818" height="250" /></a></p>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/CreateLabelTranslation.png"><img class="aligncenter size-full wp-image-986" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/CreateLabelTranslation.png" alt="" width="818" height="289" /></a></p>
<p style="text-align: center">
<p>At this point we are ready to get started on creating a very simple Visualforce page that will allow us to support two languages English and Spanish.</p>
<p>Here is our Sample page:</p>
<p>Save the following in a new Visualforce page named TestCustomLabelPage</p>
<p>&lt;apex:page controller="TestTranslationController"&gt;</p>
<p>&lt;apex:form &gt;</p>
<p>&lt;apex:pageBlock &gt;</p>
<p>&lt;apex:pageBlockSection &gt;</p>
<p>&lt;apex:pageBlockSectionItem &gt;</p>
<p>&lt;apex:outputLabel value="{!$Label.Field1Label}"&gt;&lt;/apex:outputLabel&gt;</p>
<p>&lt;apex:inputText /&gt;</p>
<p>&lt;/apex:pageBlockSectionItem&gt;</p>
<p>&lt;/apex:pageBlockSection&gt;</p>
<p>&lt;/apex:pageBlock&gt;</p>
<p>&lt;/apex:form&gt;</p>
<p>&lt;/apex:page&gt;</p>
<p>Assuming that your Salesforce.com user has the default language set to be English, let’s see how the Visualforce page will look like this at present.</p>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/VisualforcePage_English1.png"><img class="aligncenter size-full wp-image-988" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/VisualforcePage_English1.png" alt="" width="822" height="115" /></a></p>
<p>Let’s go to Edit the user and set the Language to be Espanol.</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/User_Language.png"><img class="aligncenter size-full wp-image-989" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/User_Language.png" alt="" width="784" height="134" /></a></p>
<p>Go back and refresh the Visualforce page and we should see following page [see the label is changed to Valor [Spanish for Value as we have entered in the translation for the custom label].</p>
<p style="text-align: center"><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/Visualforce_Espanol1.png"><img class="aligncenter size-full wp-image-990" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/08/Visualforce_Espanol1.png" alt="" width="819" height="59" /></a></p>
<p><strong>What is good about the translation workbench?</strong></p>
<ul>
<li>Fairly straight forward implementation as long as you are supporting the language out of the languages that Salesforce.com supports</li>
<li>Ability to add new languages over time and leverage the same code infrastructure you have setup when you supported two languages</li>
<li>Earlier it was pretty tedious to enter all the values manually, but recently Salesforce.com has added support for translation import/export from both Apex Data loader as well as Force.com Eclipse IDE</li>
</ul>
<p><strong>What is not so good about it?</strong></p>
<ul>
<li>Salesforce.com supports fairly good number of languages out of the box but the number is still pretty small so if you are supporting a language that is not part of their list you are out of luck and the only option you have at that point is to build your own code infrastructure in apex to support it</li>
<li>Limit on maximum number of custom labels. This could be critical given that salesforce.com supports maximum 5000 for the whole org. I am interpreting this as all the code within the Salesforce.com org and the all the AppExchange packages installed in that org, all of them have to share that pool of 5000 custom labels. In my opinion, this is pretty sparse. In a fairly complex AppExchange application you will come pretty close to using at least a few thousand custom labels and if you have an Org where you have 4-5 of those AppExchange apps installed then you are going to run into this problem. Having said that, there is a possibility that Salesforce.com may not count the custom labels included in the AppExchange apps with Aloha status but not sure about this.</li>
</ul>
<p><strong>Further Reading</strong></p>
<p><a href="https://na9.salesforce.com/help/doc/en/customize_wbench.htm">https://na9.salesforce.com/help/doc/en/customize_wbench.htm</a></p>
<p><a href="https://na9.salesforce.com/help/doc/en/salesforce_ide_localization.pdf">https://na9.salesforce.com/help/doc/en/salesforce_ide_localization.pdf</a></p>
<p><a href="https://na9.salesforce.com/help/doc/en/entering_translated_terms_in_packages.htm">https://na9.salesforce.com/help/doc/en/entering_translated_terms_in_packages.htm</a></p>
<p><a href="https://na9.salesforce.com/help/doc/en/salesforce_workbench_cheatsheet.pdf">https://na9.salesforce.com/help/doc/en/salesforce_workbench_cheatsheet.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/how-to-translation-workbench-in-salesforce-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running APEX Code in a Standard Approval Process</title>
		<link>http://comitydesigns.com/blog/running-apex-code-in-a-standard-approval-process/</link>
		<comments>http://comitydesigns.com/blog/running-apex-code-in-a-standard-approval-process/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 00:19:25 +0000</pubDate>
		<dc:creator>Rashi</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=886</guid>
		<description><![CDATA[Blog entry posted for: Rahul - Comity Intern (Summer&#8217;2011) .. One of the limitations of the Salesforce.com platform is that it does not allow developers to inject their own logic into an Approval Process, especially when using standard VisualForce tags. With standard related lists (not custom components) columns cannot be customized to display custom information. [...]]]></description>
			<content:encoded><![CDATA[<p><em>Blog entry posted for</em>: Rahul <em>- Comity Intern (Summer&#8217;2011)</em></p>
<p><em>..<br />
</em></p>
<p>One of the limitations of the Salesforce.com platform is that it does not allow developers to inject their own logic into an Approval Process, especially when using standard VisualForce tags. With standard related lists (not custom components) columns cannot be customized to display custom information.</p>
<p>One common way of working around this limitation is to replicate the relatedList as a custom component where you duplicate the look and feel utilizing the pageBlockTable VF tag, thereby having the ability to add any custom logic. This approach is more rewarding but far more time consuming and not always necessary.</p>
<p>Another quicker mechanism to bypass this limitation is to use a combination of CSS and HTML tags and attributes on a page in addition to APEX code that replicates the needed standard functionality.</p>
<p>As an example, let us take a look at a use case that requires us to perform a check and display an error message on a VF page upon clicking the Approve/Reject Link from the <strong><em>ProcessSteps</em></strong><strong><em> </em></strong>relatedList i.e. the Approval History.</p>
<p>One way to approach this, as highlighted in this post is to use CSS to hide the actionColumn on the standard relatedList, then provide commandButtons or commandLinks above or below the relatedList allowing the user to run custom pre-defined APEX logic.</p>
<p>In the event that the business does not require a heavily customized solution, modifying a standard related list can be the faster and more reasonable approach. However, its functionality is also limited, in the sense that using this method only allows the hiding of pre-existing columns that would otherwise be shown in the relatedList implementation. The addition of new columns is not possible and in this case one must revert to the complete custom solution.</p>
<p><span style="text-decoration: underline"><strong><em>For hiding the Action column:</em></strong></span></p>
<p>Insert the following code on the Custom  VF Page in the correct place as specified by the tags:</p>
<p class="MsoNormal" style="line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span class="GramE"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">style</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&gt;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f5fbf">/* === Hides Action Column for Approval History === */</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f5fbf"><br />
</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"> </span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px">
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">[<span class="GramE">class</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: black">$</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">='<span class="SpellE">actionColumn</span>']</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">{</span><span class="SpellE"><span class="GramE"><span style="font-size: 10.0pt;font-family: Consolas;color: #7f007f">display</span><span style="font-size: 10.0pt;font-family: Consolas;color: black">:</span></span><em><span style="font-size: 10.0pt;font-family: Consolas;color: #2a00e1">none</span></em></span><span style="font-size: 10.0pt;font-family: Consolas;color: black">}</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"><br />
</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f5fbf">/* === END === */</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f5fbf"><br />
</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;/</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">style</span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&gt;</span></p>
<p class="MsoNormal" style="padding-left: 30px">
<p><span style="color: #ff0000"><strong><span style="text-decoration: underline">NOTE:</span></strong> This will cause all columns of the name <strong>actionColumn</strong> to be hidden on the page, so only use this implementation if you are sure that nothing else has the same name or else it will disappear as well.</span></p>
<p><span style="color: #ff0000"> </span><span style="color: #ff0000">A better way would be to find the columnID because this is guaranteed to be unique at least within the page, but this is not always possible, as it was in this case.</span></p>
<p><span style="color: #ff0000"> </span><span style="color: #ff0000">So you could use this method to hide a column from a custom element in a similar manner.</span></p>
<p><span style="color: #ff0000"><br />
</span></p>
<p><span style="text-decoration: underline"><strong><em>To add commandButtons that do the same thing:</em></strong></span></p>
<div class="WordSection1">
<p class="MsoNormal">Insert the following code in the correct place on the Custom VF Page, either above or below the code that either looks like or contains the following: <span style="font-size: 10.0pt;line-height: 115%;font-family: Consolas;color: teal">&lt;</span><span style="font-size: 10.0pt;line-height: 115%;font-family: Consolas;color: #3f7f7f">apex:relatedList</span><span style="font-size: 10.0pt;line-height: 115%;font-family: Consolas"> <span style="color: #7f007f">list</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;ProcessSteps&#8221;</span></em><span style="color: teal">&gt;&lt;/</span><span style="color: #3f7f7f">apex:relatedList&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f5fbf">&lt;!&#8211; Buttons that mimic the functionality of the Action Column in the Approval History Related List &#8211;&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px">
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-family: Consolas;color: #3f5fbf"><br />
</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:form</span><span style="font-size: 10.0pt;font-family: Consolas"><span style="color: teal">&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:pageBlock</span><span style="font-size: 10.0pt;font-family: Consolas"> <span style="color: #7f007f">id</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;appRej&#8221;</span></em><span style="color: teal">&gt;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:pageBlockButtons</span><span style="font-size: 10.0pt;font-family: Consolas"> <span style="color: #7f007f">location</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;top&#8221;</span></em><span style="color: #7f007f"> id</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;appHistButtons&#8221;</span></em><span style="color: teal">&gt;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:actionRegion</span><span style="font-size: 10.0pt;font-family: Consolas"> <span style="color: teal">&gt;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:commandLink</span><span style="font-size: 10.0pt;font-family: Consolas"> <span style="color: #7f007f">value</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;Approve/Reject&#8221;</span></em><span style="color: #7f007f"> id</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;appRejectBtn&#8221;</span></em> <span style="color: #7f007f">styleClass</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;btn&#8221;</span></em> <span style="color: #7f007f">style</span><span style="color: black">=&#8221;</span><span style="color: #7f007f">padding</span><span style="color: black">:</span><em><span style="color: #2a00e1">2px 5px 3px 5px</span></em><span style="color: black">; </span><span style="color: #7f007f">text-decoration</span><span style="color: black">:</span><em><span style="color: #2a00e1">none</span></em><span style="color: black">;&#8221; </span><span style="color: #7f007f">action</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;{!ApprRej}&#8221;</span></em><span style="color: teal"> /&gt;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;/</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:actionRegion</span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&gt;</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:actionRegion</span><span style="font-size: 10.0pt;font-family: Consolas"> <span style="color: teal">&gt;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:commandLink</span><span style="font-size: 10.0pt;font-family: Consolas"> <span style="color: #7f007f">value</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;Reassign&#8221;</span></em><span style="color: #7f007f"> id</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;ReassignBtn&#8221;</span></em> <span style="color: #7f007f">styleClass</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;btn&#8221;</span></em> <span style="color: #7f007f">style</span><span style="color: black">=&#8221;</span><span style="color: #7f007f">padding</span><span style="color: black">:</span><em><span style="color: #2a00e1">2px 5px 3px 5px</span></em><span style="color: black">; </span><span style="color: #7f007f">text-decoration</span><span style="color: black">:</span><em><span style="color: #2a00e1">none</span></em><span style="color: black">;&#8221; </span><span style="color: #7f007f">action</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;{!Reassign}&#8221;</span></em><span style="color: teal"> /&gt;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;/</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:actionRegion</span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&gt;</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;/</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:pageBlockButtons</span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&gt;</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;/</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:pageBlock</span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&gt;</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;/</span><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex:form</span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&gt;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal"><br />
</span></p>
<p class="MsoNormal" style="line-height: normal;padding-left: 30px">
<p class="MsoNormal" style="line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f5fbf">&lt;!&#8211; END &#8211;&gt;</span></p>
<p>In your controller extension, create the functions that these buttons are associated to as shown below (assuming that all variables needed, functions referenced etc. have been already predefined and setup elsewhere):</p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: olive">// Function called when Approve/Reject Button is clicked</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: olive"><br />
</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span class="GramE"><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">public</span></strong></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">PageReference</span><span class="SpellE"> ApprRej</span>()</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">{</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: olive">// runs the check</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="SpellE"><span class="GramE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">approvePossible</span></span></span><span class="GramE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">(</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: black">);</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"><br />
</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"> </span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: olive">// if the check fails then it changes the flag to display error message and re-renders the current Page</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="GramE"><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">if</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black">(</span></span><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">canApprove</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> == </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">false</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black">)</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">{</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">canApprove2 = </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">false</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black">;</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">PageReference</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">pageRef</span> = <span class="SpellE"><span class="GramE">ApexPages.currentPage</span></span><span class="GramE">(</span>);</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="SpellE"><span class="GramE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">pageRef.setRedirect</span></span></span><span class="GramE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">(</span></span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">true</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black">);</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="GramE"><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">return</span></strong></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">null</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black">;</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">}</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"><br />
</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: olive">// if check is successful then it runs a SOQL query to get the Approval ID and uses that to redirect to the relevant Approve/Reject page</span><span style="font-size: 10.0pt;font-family: Consolas"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="GramE"><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">else</span></strong></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">List&lt;<span class="SpellE">ProcessInstanceWorkItem</span>&gt;<span class="SpellE"> workItemList</span> = [</span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">Select</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">p.<span style="color: #2218e6">ProcessInstance</span>.Status</span>, p.</span><span style="font-size: 10.0pt;font-family: Consolas;color: #2218e6">ProcessInstance</span><span style="font-size: 10.0pt;font-family: Consolas;color: black">.TargetObjectId<span class="GramE">,p.ProcessInstanceId,p.OriginalActorId,p.Id,p.ActorId</span> </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">From</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black"> </span><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: #2218e6">ProcessInstanceWorkitem</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> p </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">where</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">p.<span style="color: #2218e6">ProcessInstance</span>.TargetObjectId</span> = :<span class="SpellE">opp.Id</span>]; </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"><br />
</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">String <span class="SpellE">strAppId</span> = <span class="SpellE"><span class="GramE">workItemList</span></span><span class="GramE">[</span>0].Id;<br />
</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">String <span class="SpellE">partialURL</span> =</span><span style="font-size: 10.0pt;font-family: Consolas;color: green"> &#8216;/p/process/<span class="SpellE">ProcessInstanceWorkitemWizardStageManager<span class="GramE">?id</span></span>=&#8217;</span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> + <span class="SpellE">strAppId</span>; </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">canApprove2 = </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">true</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black">;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">PageReference</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">pageRef</span> = </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">new</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE"><span class="GramE">PageReference</span></span><span class="GramE">(</span><span class="SpellE">partialURL</span>);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="SpellE"><span class="GramE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">pageRef.setRedirect</span></span></span><span class="GramE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">(</span></span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">true</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black">);</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="GramE"><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">return</span></strong></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">pageRef</span>;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">}</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"><br />
</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: olive">// Function called when Reassign Button is clicked</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"><br />
</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span class="GramE"><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">public</span></strong></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">PageReference</span> Reassign()</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">{</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: olive">// runs a SOQL query to get the Approval ID and uses that to redirect to the relevant Reassign page </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0.0001pt 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: olive"> </span><span style="font-size: 10.0pt;font-family: Consolas;color: black">List&lt;<span class="SpellE">ProcessInstanceWorkItem</span>&gt; <span class="SpellE">workItemList</span> = [</span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">Select</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">p.<span style="color: #2218e6">ProcessInstance</span>.Status</span>, p.</span><span style="font-size: 10.0pt;font-family: Consolas;color: #2218e6">ProcessInstance</span><span style="font-size: 10.0pt;font-family: Consolas;color: black">.TargetObjectId,p.ProcessInstanceId,p.OriginalActorId,p.Id,p.ActorId<br />
</span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">From</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black"> </span><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: #2218e6">ProcessInstanceWorkitem</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> p </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">where</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">p.<span style="color: #2218e6">ProcessInstance</span>.TargetObjectId</span> = :<span class="SpellE">opp.Id</span>]; </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black"><br />
</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">String <span class="SpellE">strAppId</span> = <span class="SpellE"><span class="GramE">workItemList</span></span><span class="GramE">[</span>0].Id; </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">String <span class="SpellE">partialURL</span> = </span><span style="font-size: 10.0pt;font-family: Consolas;color: green">&#8216;/&#8217;</span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> + <span class="SpellE">strAppId</span> + </span><span style="font-size: 10.0pt;font-family: Consolas;color: green">&#8216;/<span class="SpellE">e<span class="GramE">?et</span></span>=<span class="SpellE">REASSIGN&amp;retURL</span>=apex/<span class="SpellE">GMAView?id</span>=&#8217;</span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> + <span class="SpellE">gma.Id</span> + </span><span style="font-size: 10.0pt;font-family: Consolas;color: green">&#8216;&amp;<span class="SpellE">sfdc.override</span>=1&#8242;</span><span style="font-size: 10.0pt;font-family: Consolas;color: black">; </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: black">PageReference</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">pageRef</span> = </span><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">new</span></strong><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE"><span class="GramE">PageReference</span></span><span class="GramE">(</span><span class="SpellE">partialURL</span>);</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span class="GramE"><strong><span style="font-size: 10.0pt;font-family: Consolas;color: #7f0055">return</span></strong></span><span style="font-size: 10.0pt;font-family: Consolas;color: black"> <span class="SpellE">pageRef</span>;</span></p>
<p class="MsoNormal" style="line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: black">}</span></p>
<p class="MsoNormal" style="line-height: normal">
<p>In this case, it is presumed that the page has an element that is rendered based on some flag <strong><em>canApprove2</em></strong></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">apex<span class="GramE">: outputPanel</span></span></span><span style="font-size: 10.0pt;font-family: Consolas"> <span style="color: #7f007f">style</span><span style="color: black">=&#8221;</span><span style="color: #7f007f">color</span><span style="color: black">:</span><em><span style="color: #2a00e1">red</span></em><span style="color: black">;</span><span style="color: #7f007f">font-size</span><span style="color: black">:</span><em><span style="color: #2a00e1">150%</span></em><span style="color: black">&#8221; </span><span style="color: #7f007f">rendered</span><span style="color: black">=</span><em><span style="color: #2a00ff">&#8220;{!NOT(canApprove2)}&#8221;</span></em><span style="color: teal">&gt;</span></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt;text-indent: 0.5in;line-height: normal;padding-left: 30px"><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">br</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">/&gt;</span><span style="font-size: 10.0pt;font-family: Consolas;color: black">Sample error message is displayed here</span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">&lt;</span><span class="SpellE"><span style="font-size: 10.0pt;font-family: Consolas;color: #3f7f7f">br</span></span><span style="font-size: 10.0pt;font-family: Consolas;color: teal">/&gt;</span></p>
<p class="MsoNormal" style="padding-left: 30px"><span style="font-size: 10.0pt;line-height: 115%;font-family: Consolas;color: teal">&lt;/</span><span class="SpellE"><span style="font-size: 10.0pt;line-height: 115%;font-family: Consolas;color: #3f7f7f">apex:outputPanel</span></span><span style="font-size: 10.0pt;line-height: 115%;font-family: Consolas;color: #3f7f7f">&gt;</span></p>
<p class="MsoNormal" style="padding-left: 30px"><span style="font-size: 10.0pt;line-height: 115%;font-family: Consolas;color: #3f7f7f"><br />
</span></p>
</div>
<div class="WordSection1">
<p><span style="color: #ff0000"><strong><span style="text-decoration: underline">NOTE:</span></strong> A better way of constructing the partial URLs is to avoid any hard-coding and instead use the setParameter and getParameter methods.</span></p>
<p><span style="color: #ff0000"> </span><span style="color: #ff0000">In case you do need to hard-code for any reason, as I have done in the above example, then you would need to click on the <strong>actionColumn</strong> commandLink that takes you to the standard page, and then copy and cleanup the URL by identifying and segregating the record ID, and also removing anywildcard or dummy Unicode/UTF characters.</span></p>
<p><span style="color: #ff0000"> </span><span style="color: #ff0000">For example, a URL that looks like this:</span></p>
<p><a href="https://cs4.salesforce.com/04iP00000004ks0IAA/e?et=REASSIGN&amp;retURL=apex%2FGMAView%3Fid%3D006P0000003MiuTIAS&amp;sfdc.override=1"><em>https://cs4.salesforce.com/04iP01234564ks0IAA/e?et=REASSIGN&amp;retURL=apex%2FGMAView%3Fid%3D006P6543213MiuTIAS&amp;sfdc.override=1</em></a><em> </em></p>
<p><span style="color: #ff0000">It has characters such as <strong><em>%2F</em></strong> which should be replaced by <strong><em>/ </em></strong>or <strong><em>%3F</em></strong> which should be changed to the <strong><em>=</em></strong> sign etc accordingly, as is necessary. This applies to ANY and ALL salesforce.com URLs.</span></p>
<p><span style="color: #ff0000"> </span><span style="color: #ff0000">Also, partialURLs should always be used preferably over fullURLs to facilitate migration of code between orgs.</span></p>
<p><span style="color: #ff0000"><br />
</span></p>
<p>The end result is that something that originally looked like this:</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/07/Cap1.png"><img class="alignnone size-large wp-image-939" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/07/Cap1-1024x132.png" alt="" width="614" height="79" /></a></p>
<p>Can now be seen showing up as this:</p>
<p><a href="http://comitydesigns.com/wordpress/wp-content/uploads/2011/07/Cap2.png"><img class="alignnone size-large wp-image-934" src="http://comitydesigns.com/wordpress/wp-content/uploads/2011/07/Cap2-1024x176.png" alt="" width="614" height="106" /></a></p>
<p>Observe that the left-hand most column missing, and also notice how the 2 new buttons have appeared at the bottom.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/running-apex-code-in-a-standard-approval-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importance of using &#8216;Informational Headers&#8217; on top of your code artifacts</title>
		<link>http://comitydesigns.com/blog/importance-of-using-informational-headers-on-top-of-your-code-artifacts/</link>
		<comments>http://comitydesigns.com/blog/importance-of-using-informational-headers-on-top-of-your-code-artifacts/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 00:32:39 +0000</pubDate>
		<dc:creator>Rashi</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=880</guid>
		<description><![CDATA[I cannot stress enough the importance of using &#8216;Informational Headers&#8217; on top of any code that you may write, regardless of what language it is or what platform that you maybe developing on. Informational Headers should provide the reader (author or another developer) with at least the following : Artifact name Associated artifacts Spawned artifacts [...]]]></description>
			<content:encoded><![CDATA[<p>I cannot stress enough the importance of using &#8216;Informational Headers&#8217; on top of any code that you may write, regardless of what language it is or what platform that you maybe developing on.</p>
<p>Informational Headers should provide the reader (author or another developer) with at least the following :</p>
<ul>
<li><span style="color: #666699">Artifact name</span></li>
<li><span style="color: #666699">Associated artifacts</span></li>
<li><span style="color: #666699">Spawned artifacts</span></li>
<li><span style="color: #666699">Purpose (summarized description) and context</span></li>
<li><span style="color: #666699">Change log</span></li>
</ul>
<p>This basic set of information allows yourself or anyone else a quick background of what you are going to view, review, edit, or deploy, including any information about dependancies if you choose to include this additional detail.</p>
<p>Well structured and commented code goes a long way, and speeds up development. Poorly structured and non-commented code makes it hard for the person that did not write it to understand and potentially delay development or even create further problems by modifying the wrong data, etc.</p>
<p>In addition a properly maintained change log allows one to track changes or updates that were made within the header, providing a quick facility to then reference the right individual for help in the event of code failure or malperformance.</p>
<p>I can list another 101 reasons in this entry, and trust me when I say that I&#8217;ve seen a lot of dirty code &#8211; it makes it very hard to move forward at a good and fast pace. SO, I urge all Technical Architects, developers (Sr. and Jr.), and to be developers to make it a practice to add &#8216;Informational Headers&#8217; to your code artifacts, it will not only save you time but also for others that inherit your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/importance-of-using-informational-headers-on-top-of-your-code-artifacts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamically Changing the &#8216;Advanced filter criteria&#8217; (boolean condition) on SFDC Reports via a URL Parameter</title>
		<link>http://comitydesigns.com/blog/dynamically-changing-the-advanced-filter-criteria-boolean-condition-on-sfdc-reports-via-a-url-parameter/</link>
		<comments>http://comitydesigns.com/blog/dynamically-changing-the-advanced-filter-criteria-boolean-condition-on-sfdc-reports-via-a-url-parameter/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 00:05:58 +0000</pubDate>
		<dc:creator>Rashi</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=875</guid>
		<description><![CDATA[Sometimes while setting up reports you wish to quickly change the advanced filter criteria (boolean condition) to make sure you are pulling the right data without having to click on &#8216;Customize&#8217; every single time. Well, you can! All you have to do is pass an additional URL parameter to your report with the new criteria [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes while setting up reports you wish to quickly change the advanced filter criteria (boolean condition) to make sure you are pulling the right data without having to click on &#8216;Customize&#8217; every single time.</p>
<p>Well, you can!</p>
<p>All you have to do is pass an additional URL parameter to your report with the new criteria for testing:</p>
<ul>
<li><span style="color: #ff0000">bool_filter</span>=<span style="color: #3366ff">1+AND+2+AND+(+3+OR+4+)</span></li>
<li>Example: https://cs1.salesforce.com/00OM0000000FAUH?<span style="color: #3366ff"><span style="color: #ff0000">bool_filter</span><span style="color: #000000">=</span>1+AND+2+AND+(+3+OR+4+)</span></li>
</ul>
<p>So lets say that your original advanced filter criteria was: <span style="color: #339966">1 AND 2 AND 3 AND 4</span>, by passing the above URL parameter your report should now show <span style="color: #3366ff">1 AND 2 AND ( 3 OR 4 ) <span style="color: #000000">as part of the advanced filter criteria. Additionally, your report data should reflect accordingly.</span><br />
</span></p>
<p>..</p>
<p>Disclaimer:</p>
<p>Any of these features could be changed by Salesforce.com in a future release.</p>
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/dynamically-changing-the-advanced-filter-criteria-boolean-condition-on-sfdc-reports-via-a-url-parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Console Layout&#8217;s URL Paramater: isdtp can be used to hide SFDC header and sidebar on Standard Pages</title>
		<link>http://comitydesigns.com/blog/console-layouts-url-paramater-isdtp-can-be-used-to-hide-sfdc-header-and-sidebar-on-standard-pages/</link>
		<comments>http://comitydesigns.com/blog/console-layouts-url-paramater-isdtp-can-be-used-to-hide-sfdc-header-and-sidebar-on-standard-pages/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 23:51:47 +0000</pubDate>
		<dc:creator>Rashi</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=868</guid>
		<description><![CDATA[Console views or layouts are extremely helpful in Salesforce.com if your business model asks for them. As you know, while using consoles the SFDC header and side bar are both hidden for all the pages that you choose to display within the consoles, the font size is smaller, and the page help link (usually found [...]]]></description>
			<content:encoded><![CDATA[<p>Console views or layouts are extremely helpful in Salesforce.com if your business model asks for them. As you know, while using consoles the SFDC header and side bar are both hidden for all the pages that you choose to display within the consoles, the font size is smaller, and the page help link (usually found on the top right of a standard page) are iconified.</p>
<p>This effect can be mimicked on standard pages by using the url parameter: <span style="color: #ff0000">isdtp</span>=<span style="color: #3366ff">mn</span> or <span style="color: #3366ff">lt</span> .</p>
<ul>
<li><span style="color: #ff0000">isdtp</span>=<span style="color: #3366ff">mn</span> will retain the old SFDC styling and retain the page header (not the SFDC header with all the tabs)</li>
<li><span style="color: #ff0000">isdtp</span>=<span style="color: #3366ff">lt</span> will retain the old SFDC styling and will remove the page header as well</li>
</ul>
<p>You can use this trick on standard page layouts as such:</p>
<ul>
<li>For example: https://cs1.salesforce.com/001C000000oaDWl?<span style="color: #ff0000">isdtp</span>=<span style="color: #3366ff">mn</span></li>
</ul>
<p>or on other native salesforce pages, such as reports. This trick allows you to you embed standard pages without the header and side bar within VF pages successfully.</p>
<p>Of course you do need to keep in mind that there are limitations to what all you can do, but nonetheless &#8216;isdtp&#8217; is a very useful URL parameter to know of.</p>
<p>..</p>
<p>Disclaimer:</p>
<p>The new SFDC styling/UI Theme has not been made available to this URL parameter, and may not work on some of the native SFDC pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/console-layouts-url-paramater-isdtp-can-be-used-to-hide-sfdc-header-and-sidebar-on-standard-pages/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Navigating to other locations within SFDC after editing a record &#8211; saveURL vs retURL</title>
		<link>http://comitydesigns.com/blog/navigating-to-other-locations-within-sfdc-after-editing-a-record-saveurl-vs-returl/</link>
		<comments>http://comitydesigns.com/blog/navigating-to-other-locations-within-sfdc-after-editing-a-record-saveurl-vs-returl/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 23:13:01 +0000</pubDate>
		<dc:creator>Rashi</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://comitydesigns.com/?p=861</guid>
		<description><![CDATA[In Salesforce.com it is standard behavior that when you edit a record, and click on &#8216;save&#8217; or &#8216;cancel&#8217;, you are returned to the detail view from where you clicked on &#8216;edit&#8217;. This also holds true if you start from a VF page that navigates you a standard edit page layout, and upon clicking on &#8216;save&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>In Salesforce.com it is standard behavior that when you edit a record, and click on &#8216;save&#8217; or &#8216;cancel&#8217;, you are returned to the detail view from where you clicked on &#8216;edit&#8217;. This also holds true if you start from a VF page that navigates you a standard edit page layout, and upon clicking on &#8216;save&#8217; or &#8216;edit&#8217; you will be redirected back to the VF page.</p>
<p>If you closely observe the URL, you may notice two query string parameters: saveURL and retURL, and by modifying one or the other or both you can control the users navigational behavior.</p>
<ol>
<li><span style="color: #ff0000">retURL</span> : allows you to redirect the user to <em>any location**</em> within Salesforce.com as allowed by permissions when they hit &#8216;Cancel&#8217;</li>
<li><span style="color: #ff0000">saveURL</span> : allows you to redirect the user to <em>any location**</em> within Salesforce.com as allowed by permissions when they hit &#8216;Save&#8217;</li>
</ol>
<p><em>**any location</em> : other salesforce records (detail or edit view), native and custom pages (VF), native tabs and custom tabs, etc.</p>
<p>Example &#8211; upon cancel the user is navigated to another record&#8217;s detail page, and upon save the user is sent to a custom VF page</p>
<ul>
<li>https://cs1.salesforce.com/a06M0000000I3dq/e?<span style="color: #ff0000">retURL</span>=<span style="color: #3366ff">%2Fa06M0000000I5ab</span>&amp;<span style="color: #ff0000">saveURL</span>=<span style="color: #3366ff">/apex/VF_PAGE_NAME</span></li>
</ul>
<p>By modifying your custom links or buttons you can control the user navigation and tailor it to your business&#8217; specific needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://comitydesigns.com/blog/navigating-to-other-locations-within-sfdc-after-editing-a-record-saveurl-vs-returl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

