<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
  <title>Anup T Jadhav</title>
  <link href="http://anupjadhav.com/"/>
  <link type="application/atom+xml" rel="self" href="http://anupjadhav.com/atom.xml"/>
  <updated>2015-10-08T22:00:56+00:00</updated>
  <id>http://anupjadhav.com/</id>
  <author>
    <name>Anup Jadhav</name>
    <email>anup.jadhav@gmail.com</email>
  </author>

  
  <entry>
    <id>http://anupjadhav.com/2015/09/25/new-blog</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2015/09/25/new-blog"/>
    <title>New Blog at anup.io</title>
    <published>2015-09-25T00:00:00+00:00</published>
    <updated>2015-09-25T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;Dear reader,&lt;/p&gt;

&lt;p&gt;Just a quick note to say that I&amp;rsquo;ve moved my new blog to &lt;a href=&quot;http://www.anup.io&quot;&gt;http://www.anup.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;kthanxbai!&lt;/p&gt;

&lt;p&gt;Anup&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2015/03/25/trailhead-lightning-components</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2015/03/25/trailhead-lightning-components"/>
    <title>Start Learning Lightning Components with Trailhead</title>
    <published>2015-03-25T00:00:00+00:00</published>
    <updated>2015-03-25T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;img src=&quot;/images/lightning-image.jpg&quot; width=&quot;40%&quot; alt=&quot;Lightning Strikes&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you don&amp;rsquo;t like reading pages and pages of technical documentation, instead (like me) prefer to learn the basic concepts quickly and then get your hands dirty by building something, then you should checkout &lt;a href=&quot;https://developer.salesforce.com/trailhead&quot;&gt;Trailhead&lt;/a&gt;, an interactive learning platform to grasp basic and advanced concepts of the Salesforce platform.&lt;/p&gt;

&lt;p&gt;One of the appealing features of Trailhead is that it caters to both newbies who are just starting their salesforce journey, and experienced pros who have been building applications on the platform for some time. Trailhead is comprised of modules which in turn contain tutorials with an exercise at the end for the user to complete and earn points. When you complete all tutorials in a module you get a badge that you can show off on your community profile. Each module is focussed on one topic or feature and they can be completed in any order.&lt;/p&gt;

&lt;p&gt;Experienced developers and admins will breeze through the first few modules on platform basics, data model, security etc. The advanced sections around business processes, Visualforce, Apex, Process Builder and Lightning  will definitely teach you something new. And did I mention that you can earn points and badges along the way.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/trailhead-badges.png&quot; width=&quot;40%&quot; alt=&quot;Trailhead Badges&quot; /&gt;&lt;/p&gt;

&lt;p&gt;My current favourite module is unsurprisingly about &lt;a href=&quot;https://developer.salesforce.com/trailhead/module/lightning_components&quot;&gt;Lightning Component&lt;/a&gt;. Lightning Components and the App builder will revolutionize how we build enterprise apps and custom functionality on the platform. If you want to learn about components, you can either download the developer guides, or you could try out the trailhead module for Lightning components.&lt;/p&gt;

&lt;p&gt;The module covers the following units:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Getting started with Components&lt;/li&gt;
&lt;li&gt;Creating Components&lt;/li&gt;
&lt;li&gt;Defining Component Attributes&lt;/li&gt;
&lt;li&gt;Using Expressions&lt;/li&gt;
&lt;li&gt;Using Standard and Force.com components&lt;/li&gt;
&lt;li&gt;Handling events with Client side controllers&lt;/li&gt;
&lt;li&gt;Using javascript controllers with components&lt;/li&gt;
&lt;li&gt;Using apex in Components&lt;/li&gt;
&lt;li&gt;Debugging your components&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;At the end of each unit you can complete an exercise and earn points. Don&amp;rsquo;t skip the exercise since it helps you reinforce the understanding of key concepts and facts covered in the unit.&lt;/p&gt;

&lt;p&gt;The key takeaway is that if you are familiar with Visualforce and Apex, and want to start building components asap, then this module will get you started.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2014/12/13/Salesforce-Deployment-Thoughts</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2014/12/13/Salesforce-Deployment-Thoughts"/>
    <title>Thoughts on Automating Salesforce Deployment</title>
    <published>2014-12-13T00:00:00+00:00</published>
    <updated>2014-12-13T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;img src=&quot;/images/cloud-deployment.jpg&quot; alt=&quot;Deploy button&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Deployment is one of the most important parts of any software project. Depending on the size of the project, the deployment could be anything from a two minute activity for one person to a two day endeavor for an army of resources. Of course the holy grail of deployments is achieving the &lt;a href=&quot;http://www.infoq.com/articles/Continuous-Delivery-Maturity-Model&quot;&gt;Expert (Level 5) maturity level&lt;/a&gt; in Continuous Delivery. To reach this goal, you should always be looking for ways to automate the deployment process. For example, you want an automated process that checks out code from the master branch of your Version Control System (VCS), runs all tests, validates the deployment and then deploys it to the production environment (ideally) without human intervention. All of this will lead to Continuous Delivery nirvana.&lt;/p&gt;

&lt;p&gt;Unfortunately, it is currently not possible to implement such a strategy on the Salesforce1 platform. While salesforce.com has significantly innovated how we build, compile, debug and test code in the cloud, one of the things with which both newbies and seasoned developers still struggle is automating deployments.&lt;/p&gt;

&lt;p&gt;So what’s the solution? To start, let’s look at the deployment options currently available on the platform:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Manual Migration&lt;/strong&gt;: Manually repeat the exact modifications in every development or production organization. This approach is tedious and time-consuming, therefore it’s only recommended for very small changes and for components that cannot be deployed by Metadata API or change sets.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Eclipse IDE Plugin&lt;/strong&gt;: Deploy components (that can be deployed using Metadata API) from the Eclipse IDE using the Force.com plugin. This approach is not recommended for large deployments because you will be locked out of your IDE, which sometimes has a tendency to crash for long running operations. Additionally, this approach requires you to track the components being deployed separately very diligently since the IDE does not track this information for you.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Ant Migration Tool&lt;/strong&gt;: A command-line utility for moving metadata between a local directory and a Salesforce organization using the Metadata API. This approach is recommended for multi-stage release processes and/or if you prefer to write automated scripts for the deployment. Although this approach isn’t perfect, for example there are Metadata API limitations, it’s the only option that brings some element of automation to the deployment.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Change Sets&lt;/strong&gt;: Send customizations and modifications from one organization to another. Change sets can only be sent between organizations that are affiliated with a production organization — for example, a production organization and a sandbox or two sandboxes created from the same organization. I sometimes prefer change sets because, with the right process, you can keep track of deployments being made to different environments.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Why can’t any of these approaches be fully automated? The answer is five-fold:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Not &lt;a href=&quot;http://www.salesforce.com/us/developer/docs/api_meta/index_Left.htm#StartTopic=Content/meta_unsupported_types.htm?SearchType=Stem/&quot;&gt;all components can be deployed&lt;/a&gt; via Metadata API. There are some changes, such as Account Teams, Case team roles, Console layout, etc., that you must deploy manually. While the Metadata API does allow you to automate the deployment of important components like Apex code and sObject metadata, it falls short of 100% automation.&lt;/li&gt;
&lt;li&gt; Large deployments take an inordinate amount of time, and a single unit test failure requires aborting the deployment process, fixing the test class and starting over again. Some of the reasons that affect deployment time are:

&lt;ul&gt;
&lt;li&gt;Number and size of files - no brainer really, the more you have to deploy, the longer it takes to deploy&lt;/li&gt;
&lt;li&gt;Type of components - Some components like custom fields, custom junction objects etc. take longer to deploy than others&lt;/li&gt;
&lt;li&gt;Processing time - if you make a change that requires updating data records, then it&amp;rsquo;ll take more time e.g. changing field type&lt;/li&gt;
&lt;li&gt;Test Execution - more tests you have, more time it&amp;rsquo;ll take&lt;/li&gt;
&lt;li&gt;Network and server availability - if you deploy during peak hours, then you might notice a slight delay in deployment&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; For large deployments that involve deleting and/or renaming a field or object, creating a new sharing rule, etc., you end up doing manual pre- and post-deployment steps.&lt;/li&gt;
&lt;li&gt; It’s impossible to rollback your changes from production if your deployment goes horribly wrong or if you find a show-stopping bug in your post-deployment smoke tests. You cannot revert back to a previous version of code, metadata and data, so the only strategy is to roll forward.&lt;/li&gt;
&lt;li&gt; You can deploy sObject schema changes, but you cannot automate the deployment of data changes along with it.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;While these obstacles to a completely automated deployment are not ideal, they’re not unique to Salesforce. In fact, these types of obstacles are common among cloud platforms. This leaves salesforce.com in a unique position to innovate and lead the charge in improving cloud deployment capabilities. If I had a wish list, I’d ask for the following abilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Rollback a deployment&lt;/li&gt;
&lt;li&gt; Deploy (almost) everything under setup via the Metadata API&lt;/li&gt;
&lt;li&gt; An elegant way to capture and track code and metadata changes deployed from one environment to another&lt;/li&gt;
&lt;li&gt; Make 75% test coverage mandatory in sandbox environments&lt;/li&gt;
&lt;li&gt; Create and trigger change set deployment via the Ant Migration toolkit&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;While seeing this wish list fulfilled would be fantastic, this is a hard problem to solve and will take time. In the meantime, though, there are steps you can take to improve the situation. It all starts by creating a deployment strategy that is aligned with your organization’s internal release management strategy. Doing so should enable you to automate as much of your deployment process as possible. Your deployment strategy should include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; A VCS system to support deployments to different environments.&lt;/li&gt;
&lt;li&gt; A mix of Ant Migration tools (for components that can be deployed via Metadata API) and change sets (for components that cannot be deployed via Metadata API).&lt;/li&gt;
&lt;li&gt; Processes that make deployments easy without affecting developers’ time:

&lt;ul&gt;
&lt;li&gt;Developers should commit their code daily in the project/dev branch&lt;/li&gt;
&lt;li&gt;The master branch should be linked to the production instance&lt;/li&gt;
&lt;li&gt;Any changes to the master branch should be reverse integrated with other dev branches&lt;/li&gt;
&lt;li&gt;A release manager should write automated scripts to manage metadata and deploy from VCS branches to different environments&lt;/li&gt;
&lt;li&gt;A template should track changes that are manually migrated or deployed using change sets&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt; A continuous integration process to run tests automatically whenever something is committed to the project/dev branch or the master branch to ensure the branch is always deployable.&lt;/li&gt;
&lt;li&gt; Depending on the size of the project and team, you may also need a dedicated release management team to manage deployments and releases by enforcing the process and policies.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;So, even though we cannot fully automate deployments on the Force.com platform yet, we can still build processes and workflows that will automate up to 75% of the requirements. Going forward, we can hope that a cloud innovator like salesforce.com will take the lead in this space, improving the process not only for its own platform but for other cloud platforms as well.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2014/11/17/Thoughts-on-Lightning</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2014/11/17/Thoughts-on-Lightning"/>
    <title>Thoughts on Salesforce1 Lightning</title>
    <published>2014-11-17T00:00:00+00:00</published>
    <updated>2014-11-17T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;img src=&quot;/images/LightningLogo.png&quot;  alt=&quot;Lightning Logo&quot; /&gt;&lt;/p&gt;

&lt;p&gt;At &lt;a href=&quot;http://www.salesforce.com/dreamforce/DF14/&quot;&gt;Dreamforce&lt;/a&gt; this year, the weather outside Moscone centre was bright and sunny, but inside the centre the attendees were struck by Lightning.
I am sure most of you have heard of Lightning by now. Some of you eager beavers might have even started hammering out Lightning components and apps already to
show off your &amp;lsquo;early adopter&amp;rsquo; badge and I look forward to seeing your components. For those of you who are curious or mildly interested in what
might be as revolutionary announcement as Apex and Visualforce was back in 2008, keep reading.&lt;/p&gt;

&lt;p&gt;Lightning is an umbrella marketing term for a number of different technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lightning Framework and components&lt;/li&gt;
&lt;li&gt;Lightning App Builder&lt;/li&gt;
&lt;li&gt;Lightning Connect&lt;/li&gt;
&lt;li&gt;Lightning Schema Builder&lt;/li&gt;
&lt;li&gt;Ligtening Process Builder&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Lightning Framework and Components&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/images/LightningLayer.jpg&quot;  alt=&quot;Lightning Layer&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Salesforce has been working on a component based UI framework internally called &lt;a href=&quot;https://github.com/forcedotcom/aura&quot;&gt;Aura Framework&lt;/a&gt; which they open sourced in 2013. Aura comes
with a rich and extensible component set that is optimized for different devices. It is comparable to frameworks/libraries like Polymer (by Google), React
(by Facebook). Comparable, but not similar since Aura is a framework for building custom components whereas Polymer and React are libraries
for building Web/view Components. You can think of Lightning Framework being a port of the open source Aura Framework. Using the Lightning Framework you can build Lightning
 Components - a self-contained and reusable unit of an application that can range in granularity from a single line of text to an entire app.
 With its stateful client and stateless client architecture (more on that later) it is ideal for use with the Salesforce1 mobile app. Infact, the new
 Salesforce1 mobile app itself was built using Lightning Components.&lt;/p&gt;

&lt;p&gt; One of the main differences between Lightning components and something like Visualforce component is &lt;strong&gt;performance&lt;/strong&gt;. Good old Visualforce performance
 suffers from viewstate hangover, and is not ideal for building apps for Salesforce1 mobile. LC solves this problem by using a stateful client
 and stateless server architecture that relies on Javascript on the client side to manage UI component metadata and application data.
Client and server exchange data in JSON format and is much faster than vf page and components that manages some aspects of the data using
viewstate.&lt;/p&gt;

&lt;p&gt;Also components follow the event driven programming paradigm (similar to Java Swing and javascript in browser) where you write handlers that
respond to interface events as they occur. When a user interacts with the interface, the javascript controller actions will fire either a component event
(handled by the component itself) or an Application event (handled by components that subscribe to these events).&lt;/p&gt;

&lt;p&gt;In your typical force.com application you have 2 main components - the visualforce page (handles the M &amp;amp; V in MVC), and the Apex controller.
A Lightning component is comprised of one or more of the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Javascript controller&lt;/li&gt;
&lt;li&gt; Javascript helper&lt;/li&gt;
&lt;li&gt; CSS styles&lt;/li&gt;
&lt;li&gt; Component or Application  (this is the only required resource in the bundle)&lt;/li&gt;
&lt;li&gt; Server side Apex controller (similar to VF controller)&lt;/li&gt;
&lt;li&gt; Documentation&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Note that the framework is still Beta and is not GA yet so if you want to play with it you need to spin a new DE org and use the Developer
Console to write Lightning apps. Also, force.com canvas apps will stop working when you enable LC, enables Namespace prefix in your org, and it is only available to build
Salesforce1 apps at the moment.
The purpose of this article is to familiarise you with the high level structure. Head over to the Lightning components &lt;a href=&quot;https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/&quot;&gt;documentation&lt;/a&gt; to grok more
details.&lt;/p&gt;

&lt;h3&gt;Lightning App Builder&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/images/LightningAppBuilder.png&quot;  alt=&quot;Lightning App Builder&quot; /&gt;&lt;/p&gt;

&lt;p&gt;LAB is a new UI tool that will allow system administrators to create apps, add components to existing apps and/or standard/custom pages
using out of the box (standard) components provided by SF and custom components built by developers using a drag and drop interface.
They will be able to achieve this without writing a single line of code. LAB is still in development and might change in look and feel.&lt;/p&gt;

&lt;h3&gt;Lightning Process Builder&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;/images/LightningProcessBuilder.png&quot;  alt=&quot;Lightning Process Builder&quot; /&gt;&lt;/p&gt;

&lt;p&gt;LPB is a UI tool for visualizing and build automated business processes. If workflow rules is C, then LPB is C++. It will replace
workflow rules and approval processes. LPB has additional actions like - create chatter posts with @mentions, create sObject records without
apex, update child/related records. This should let you get rid of some apex code.
It will NOT replace Visual Flow because they are not the same thing.
If you want to play with it is available in beta with the Winter &amp;lsquo;15 release.&lt;/p&gt;

&lt;h3&gt;Lightning Connect (aka Platform Connect aka External Data Sources)&lt;/h3&gt;

&lt;p&gt;Lightning Connect enables your users to view data stored in external systems on-demand(via RESTful queries) as External Objects.
The data should either be in oData format or imported using the Apex Connector Framework and (obviously) must be accessible via the internet.
It&amp;rsquo;s important to note that
by using Lightning Connect you are not using your (limited and expensive) data storage but requesting and using data on demand using
API queries. Therefore there are limits to queries per hour and request and response size amongst other limits.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/LightningConnectLimits.png&quot;  alt=&quot;Lightning Connect Limits&quot; /&gt;&lt;/p&gt;

&lt;p&gt;External Objects are represented as sObjectName__x (instead of __c) and is Read-only. Once your data is exposed as an oData source, you
can setup External Object(s) declaratively. Checkout this presentation about External Data Sources for more information.&lt;/p&gt;

&lt;p&gt;A number of integration partners like Informatica Cloud, Jitterbit, Mule etc have also announced connectors to translate data to oData format
to support Connect integration. This should replace some of the existing integration implementation solution.&lt;/p&gt;

&lt;h3&gt;Lightning Schema Builder&lt;/h3&gt;

&lt;p&gt;Nothing new here, just a rebrand of the Schema builder that we know and love.&lt;/p&gt;

&lt;p&gt;This overview is just a brief description of all that is now possible with Lightning. With Lightning you can now build really awesome mobile and
desktop apps lightning fast thereby reducing the gap between an idea and implementation.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2014/09/02/Salesforce-Record-Access-Checklist</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2014/09/02/Salesforce-Record-Access-Checklist"/>
    <title>Salesforce Record Access Checklist</title>
    <published>2014-09-02T00:00:00+00:00</published>
    <updated>2014-09-02T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;img src=&quot;/images/checklist.jpg&quot; alt=&quot;Winter 15&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ever since I read &lt;a href=&quot;http://atulgawande.com/book/the-checklist-manifesto/&quot;&gt;The Checklist Manifesto&lt;/a&gt; by Atul Gawande I have been creating checklists for some of the critical dev tasks.
I have created a checklist for Salesforce deployment and for writing unit tests. These checklists are not ready to be shared yet because
they need some tweaks and more real world use. Lately I have been working on several defects and issues around record access, particularly around
why a user cannot access or search for a particular sObject record in Salesforce.&lt;/p&gt;

&lt;p&gt;This has resulted in a checklist (or a list of steps to follow) to investigate or debug user access.
Before we jump into the checklist lets review the different elements of standard &lt;a href=&quot;https://developer.salesforce.com/page/An_Overview_of_Force.com_Security&quot;&gt;Salesforce security&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Profiles - Defines application permissions(layout, apps, tabs etc), object permissions(CRUD, field level security), and system permissions(manage users, modify all data etc).&lt;/li&gt;
&lt;li&gt;Org Wide Defaults (OWD) - Used to set default access to sObject records (database rows).&lt;/li&gt;
&lt;li&gt;Sharing Rules - Is used to open up access to sObject records to roles, groups, individual users etc. It cannot be more restrictive than OWD.&lt;/li&gt;
&lt;li&gt;Sharing Sets - Is used to give internal users (with a Salesforce license) access to records created by Communities/Portal users.&lt;/li&gt;
&lt;li&gt;Roles - provides access to records in a hierarchical fashion.&lt;/li&gt;
&lt;li&gt;Groups - Used to give record access to a group of individuals, roles, and other groups.&lt;/li&gt;
&lt;li&gt;Implicit Sharing - also called Built-in sharing gives users (Read only) access to parent account if you have access to its child record and vice versa. Also provides limited account and contact access to portal users.&lt;/li&gt;
&lt;li&gt;Record Ownership - If you own the record, then you can probably do CRUD action on the record.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Without futher ado, I present the &lt;code&gt;Salesforce record access checklist&lt;/code&gt; to investigate why a user cannot read/view or search a particular record.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check the &lt;strong&gt;owner&lt;/strong&gt; of the record. If the user searching for the record is the owner of the record but can&amp;rsquo;t find it using the Global search then
go to Step 5. If the user trying to access the record is not the owner of the record, go to Step 2.&lt;/li&gt;
&lt;li&gt;Check if the user&amp;rsquo;s &lt;strong&gt;Profile&lt;/strong&gt; has at least &amp;lsquo;Read&amp;rsquo; permission for the sObject. If the user belongs to a Profile that does not have &lt;em&gt;any&lt;/em&gt; access
to the sObject then sharing rules and OWD don&amp;rsquo;t apply (even if it is set to Public Read/Write). If the user does not have these Object permissions then you have found the source of the problem, else go to step 3.&lt;/li&gt;
&lt;li&gt;Check the &lt;strong&gt;OWD&lt;/strong&gt; for the sObject and the users &lt;strong&gt;role hierarchy&lt;/strong&gt;

&lt;ol type=&quot;a&quot;&gt;
&lt;li&gt;If the OWD is Public Read/Write or Public Read Only go to step 5.&lt;/li&gt;
&lt;li&gt;If the OWD is Private, check to see if there are any sharing rules that open up record access. If the OWD is private and there are no sharing
rules opening up access you have found the issue.&lt;/li&gt;
&lt;li&gt;If there are sharing rules opening up access check if the user belongs to a group or role in the sharing rule. If the user is part of the role or group used in the sharing rule,
then go to Step 4. If the user is not part of the role or group used in the Sharing Rule, then you have found the issue.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Check to see if the record being accessed is owned by a Communities/Portal user. If not then go to step 5, else check to see if there are &lt;strong&gt;Sharing
Sets&lt;/strong&gt; defined to provide access to internal users. If there are no Sharing Sets defined and the owner of the record is a Communities/Portal user, then you have found the problem, otherwise go to Step 5.&lt;/li&gt;
&lt;li&gt;This step is only applicable if the user can view the record but is not able to search for the record using Global Search. Check the users
profile to see if the &lt;strong&gt;Tab&lt;/strong&gt; is hidden for the sObject. If it is hidden, then the sObject record will not be displayed in the search results and you have
found the problem. Otherwise go to Step 6.&lt;/li&gt;
&lt;li&gt;If you have reached this step and still haven&amp;rsquo;t found the source of the problem, raise a ticket with Salesforce Support for further analysis.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;strong&gt;&lt;em&gt;Addendum&lt;/em&gt;&lt;/strong&gt;: modified checklist if the user can read/view the record but cannot Update or Delete the record.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check if the user&amp;rsquo;s &lt;strong&gt;Profile&lt;/strong&gt; has Update and/or Delete permission for the sObject. If the user belongs to a Profile that does not have these permissions
to the sObject then sharing rules and OWD don&amp;rsquo;t apply (even if it is set to Public Read/Write). If the user does not have these Object permissions then you have found the source of the problem, else go to step 2.&lt;/li&gt;
&lt;li&gt;Check the &lt;strong&gt;OWD&lt;/strong&gt; for the sObject and the users &lt;strong&gt;role hierarchy&lt;/strong&gt;

&lt;ol type=&quot;a&quot;&gt;
&lt;li&gt;If the OWD is Private, check to see if there are any sharing rules that open up record access for read/write. If the OWD is private and there are no sharing
rules opening up access you have found the issue.&lt;/li&gt;
&lt;li&gt;If there are sharing rules opening up access for read/write check if the user belongs to a group or role in the sharing rule. If the user is part of the role or group used in the sharing rule,
then go to Step 3. If the user is not part of the role or group used in the Sharing Rule, then you have found the issue.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Check to see if the record being accessed is owned by a Communities/Portal user. If not then go to step 4, else check to see if there are &lt;strong&gt;Sharing
Sets&lt;/strong&gt; defined to provide access to internal users. If there are no Sharing Sets defined and the owner of the record is a Communities/Portal user, then you have found the problem, otherwise go to Step 4.&lt;/li&gt;
&lt;li&gt;If you have reached this step and still haven&amp;rsquo;t found the source of the problem, raise a ticket with Salesforce Support for further analysis.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;If you have found an error or would like to improve the checklist please leave a comment or reach out to me on Twitter.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2014/09/01/Salesforce-ID-In-Set</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2014/09/01/Salesforce-ID-In-Set"/>
    <title>Salesforce ID Set Gotcha</title>
    <published>2014-09-01T00:00:00+00:00</published>
    <updated>2014-09-01T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;This is another one of those gotcha posts about the quirks of the apex language that newbies need to be aware of.
Lets consider the following scenario. You have an sObject where you store an id for another sObject as a String.
For e.g. lets take an sObject called Invoice&lt;strong&gt;c which has a text field (length - 18) called serviceId&lt;/strong&gt;c which stores
a reference to a related Service__c object. The reason you are using a text field instead of an ID field
is because you have reached your limit of adding master-detail or lookup relationships to the Invoice sObject.&lt;/p&gt;

&lt;p&gt;Also, lets say when you create the Invoices you populate it with the Service Id like this.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;n&quot;&gt;Invoice__c&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Invoice__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0001&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Description__c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Invoice&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serviceID__c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serviceObj&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;insert&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then later in the code you do a query to retrieve Service sObject records and use
the Service record Ids to retrieve the corresponding Invoice records.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;SalesforceIDTest&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;isIt18CharacterID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Service__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serviceList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Id&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Service__c&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Type__c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Professional&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;Set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serviceIDSet&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;();&lt;/span&gt;
      
      &lt;span class=&quot;c1&quot;&gt;// Add the service id to the serviceIDSet&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;// Most importantly if you debug the service id now it will be 15 character id&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Service__c&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serviceList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;The&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;is:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;serviceIDSet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

      &lt;span class=&quot;c1&quot;&gt;// Now query the Invoice records using the service Id&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;// This won&amp;#39;t return any records&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Invoice__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;invoices&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ID&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Invoice__c&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;serviceId__c&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;serviceIDSet&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;invoices&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// output is 0&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;  
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Why did the query to retrieve the invoice records did not return any results? Can you guess?&lt;/p&gt;

&lt;p&gt;The problem is introduced in &lt;strong&gt;line 36&lt;/strong&gt; when you add the service record id to the serviceIDSet.
Apex will automatically convert the &lt;em&gt;15 character id&lt;/em&gt; to the equivalent &lt;em&gt;18  character version&lt;/em&gt; when you
add it to the Set. This is not an issue if you use the set as a bind variable for an ID field, but
you need to be aware of this if you are using the ID set bind variable with a text field (as shown above).&lt;/p&gt;

&lt;p&gt;The solution is to use a Set&amp;lt;String&gt; instead of a Set&amp;lt;ID&gt;. As a general rule if you are using a bind variable
in a soql, try and use the same datatype as the field used in the where clause to avoid issues.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2014/08/31/why-attend-Dreamforce14</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2014/08/31/why-attend-Dreamforce14"/>
    <title>Why You Should Attend Dreamforce</title>
    <published>2014-08-31T00:00:00+00:00</published>
    <updated>2014-08-31T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;I have never been to Dreamforce and therefore I am quite excited to attend DF14 this year at San Fransisco.
Since I don&amp;rsquo;t have first hand experience of attending Dreamforce I have selected a list of blog posts from MVPs
and rockstars from the Salesforce community who have written about why you should attend Dreamforce.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Bob Buzzard (@Bob_Buzzard) - &lt;a href=&quot;http://bobbuzzard.blogspot.co.uk/2014/08/why-you-have-to-attend-dreamforce.html&quot;&gt;Why you have to attend Dreamforce&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kartik Visanadha (@logontokartik) &lt;a href=&quot;http://salesforcetech.wordpress.com/2014/08/12/why-should-a-developer-attend-dreamforce-developers-point-of-view&quot;&gt;Why should a Developer Attend Dreamforce?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shivanath Devinarayanan (@ShivanathD) &lt;a href=&quot;http://blog.shivanathd.com/2014/08/Why-Attend-Dreamforce.html&quot;&gt;Top Reason why you should attend Dreamforce&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Matt Lacey (@laceysnr) &lt;a href=&quot;http://www.laceysnr.com/2014/08/the-benefits-of-sending-your-developers.html&quot;&gt;The Benefits of Sending Your Developers to Dreamforce&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simon Lawrence (@srlawr) &lt;a href=&quot;http://srlawr.blogspot.co.uk/2014/08/why-you-should-absolutely-let-your.html&quot;&gt;Why you should absolutely let your employees attend Dreamforce&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This is by no means an exhaustive list but if you read these posts you will get a fairly good idea of why you should attend Dreamforce this year.
See you at Dreamforce! :-)&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2014/08/30/winter-15-release</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2014/08/30/winter-15-release"/>
    <title>Winter &#39;15 Release Highlights</title>
    <published>2014-08-30T00:00:00+00:00</published>
    <updated>2014-08-30T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;img src=&quot;/images/winter15.png&quot; class=&quot;noclip&quot; alt=&quot;Winter 15&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Salesforce Winter &amp;lsquo;15 Release is upon us and I have cherrypicked some of the items
that I find interesting and highlighted them below. Let me know in the comments which new feature has got you all excited.&lt;/p&gt;

&lt;h3&gt;SalesforceA - App Enhanced with new features&lt;/h3&gt;

&lt;p&gt;Looks like you can now access system status site from the SalesforceA app. Previously you had to go to trust.salesforce.com in your browser. This
is a minor but very convenient improvement that will make you use the SalesforceA app even more.
You can (finally) switch between multiple accounts in different organisations without having to log out and log back in. This is a great improvement
in user experience and will make the app more usable (a boon for consultants like me who work on multiple projects).
Another UI improvement is to show the user task buttons as action icons that are available from the action bar at the bottom of the page.
More details can be found
&lt;a href=&quot;http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_mobile_salesforceA.htm&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Communities - Community Designer&lt;/h3&gt;

&lt;p&gt;If you have worked with Communities and wanted to build a community site using point and click you had to use Site.com. It looks like it has now
been replaced (only for Communities) with &lt;a href=&quot;http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_networks_comm_designer.htm&quot;&gt;Community Designer&lt;/a&gt;
that lets you create, brand and publish a custom community site. You can also
configure single sign-on access portals using templates. You get to choose from four templates and then style the pages to match your company&amp;rsquo;s
branding. If you skip the templates you can use Site.com instead.&lt;/p&gt;

&lt;h3&gt;Force.com - Advanced Setup Search&lt;/h3&gt;

&lt;p&gt;Setup search is one of the most time saving feature in the full Salesforce site. I don&amp;rsquo;t have to trawl through bazillion options under setup anymore
to find the correct option. Nowadays, I just search for the setup item that I am looking for using Setup search, so much so, that I don&amp;rsquo;t even remember the
setup structure anymore. Winter &amp;lsquo;15 now lets you search more items like static resources (yay!), queues, workflow rules and tasks (finally!) and
many more. You can find the full list &lt;a href=&quot;http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_forcecom_setup_search.htm&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Force.com - Deploy with Active Jobs&lt;/h3&gt;

&lt;p&gt;Another time saver feature is the new option added to the Deployment Settings that lets you to deploy components (apex class, VF page etc.)
referenced by Active apex jobs that are pending or in progress. Not being able to save code (in sandbox) or to see production deployments fail because there
were &amp;lsquo;jobs pending or in progress&amp;rsquo; was a great source of irritation to me. With this option, I don&amp;rsquo;t have to cancel the jobs anymore (yay!). Great news
indeed for salesforce developers and release managers everywhere!&lt;/p&gt;

&lt;h3&gt;Force.com - Serve static resources from VF Domain&lt;/h3&gt;

&lt;p&gt;When this update is enabled in your org, all static resources will be loaded from the Visualforce Domain instead of the Salesforce Domain. If you
are not following the best practice of using the $Resource global variable and the URLFOR() function to reference static resources then this change
to the orgin domain can cause absolute references to static resources to break. Something to bear in mind.&lt;/p&gt;

&lt;h3&gt;Force.com - Queueable Interface&lt;/h3&gt;

&lt;p&gt;This is a new interface that you can implement to run jobs asynchronously and is (arguably) a better way to run apex code asynchronously compared to the @future annotation.
You can add jobs using this interface to the queue
and monitor them. They are similar to future methods but give you additional benefits like getting an id for your job that you can use to monitor your
job, and you can also chain one job to another by starting a second job from the running job.
Check out the &lt;a href=&quot;http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_apex_queueing_jobs.htm&quot;&gt;release notes&lt;/a&gt;
for more details and code sample.&lt;/p&gt;

&lt;h3&gt;Force.com - Run more Future Methods and Callouts&lt;/h3&gt;

&lt;p&gt;Salesforce continues to deliver on its promist to relax the governor limits as the platform evolves.
You can now run 50 future methods in a single Apex invocation and the maximum number of callouts in transaction has now been increased to 100.&lt;/p&gt;

&lt;p&gt;These were some of my favourite features in this release.
You can find the release notes &lt;a href=&quot;http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_included_release_notes.htm&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2014/07/31/summer-14-release</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2014/07/31/summer-14-release"/>
    <title>Summer 14 Release Highlights</title>
    <published>2014-07-31T00:00:00+00:00</published>
    <updated>2014-07-31T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;Summer &amp;lsquo;14 release is here and it is full of awesome features. I have listed some of the features that I find interesting and useful.&lt;/p&gt;

&lt;h3&gt;Salesforce1 - Access More Custom Objects&lt;/h3&gt;

&lt;p&gt;Previously you could only access custom objects in the Salesforce1 app that were included in the app but now you can view any custom object
that has a tab in the full Salesforce site. You can also see up to 200 of your list views for an object.&lt;/p&gt;

&lt;h3&gt;Salesforce1 - Access Publisher Actions without Chatter Enabled&lt;/h3&gt;

&lt;p&gt;This is a subtle but very useful feature that allows Salesforce1 users to create and access Publisher and Publisher Actions even if your organisation has decided
to turn off Chatter. If chatter is disabled you can create global actions, actions list, object-specific actions and actions list.
Please note that this feature is only available on the Salesforce1 mobile browser app and not on the standalone Salesforce1 app.&lt;/p&gt;

&lt;h3&gt;Salesforce1 - Drill down to reports and records from  Dashboards&lt;/h3&gt;

&lt;p&gt;Another convenient feature if you access your reports and dashboards on the go. You can now drill down to individual records and reports from Dashboards.
Reports can be viewed in tabular, summary, or Top N format and you can see a maximum of 100 records.&lt;/p&gt;

&lt;h3&gt;Force.com - Light or Enterprise Custom Objects&lt;/h3&gt;

&lt;p&gt;This is an interesting feature that you need to be aware of because it might have some license implication especially if you use Force.com Light App or
Force.com Enterprise App Licenses. A custom object is classified as Enterprise Application Object if they have these settings enabled - Allow Sharing,
Allow Bulk API access, Allow Streaming API Access, otherwise it is a Light Application Object. Ofcourse, objects created before Summer &amp;lsquo;14 have these
settings enabled by default and are therefore classified as Enterprise Application Object.&lt;/p&gt;

&lt;h3&gt;Force.com - New Rich Text Editor for HTML Area Home Page Components&lt;/h3&gt;

&lt;p&gt;The new version of the rich text editor in HTML Area home page components supports more markup but does NOT allow HTML to be manually entered. If your HTML
Area home page component contains Javascript, CSS, iframes or other unsupported markup will be supported and continue to work till Summer &amp;lsquo;15. It will
stop working in Summer &#39;15 and later versions. Depending on your use case you can either deprecate the functionality or move it to the new Visualforce Area component instead.
Visualforce Area home page components can be added to the narrow or the wide column of the home page layout, andthe referenced Visualforce page
can use a standard or custom controller&lt;/p&gt;

&lt;h3&gt;Apex - Describe Limits Removed&lt;/h3&gt;

&lt;p&gt;This is great news, especially for ISV developers, but also for developers who use Dynamic Apex a lot. You are no longer limited to describing 100
sObjects or to executing 100 describe statements. You don&amp;rsquo;t have to write weird workarounds for this limit anymore because all describe limits have been
removed.&lt;/p&gt;

&lt;h3&gt;Apex - Submit more Batch Jobs with Apex Flex Queue (Pilot)&lt;/h3&gt;

&lt;p&gt;Another exciting feature that I can&amp;rsquo;t wait to get my hands on is the new and shiny Apex Flex Queue. I find apex batch jobs extremely useful especially on Enterprise projects that deal
with large volumes of data. If you enable this pilot feature, you are now no longer limited to running up to 5 batch jobs simultaneously. The Apex Flex Queue pilot enables you to submit
batch jobs beyond the allowed limit of five queued or active jobs. If the submitted jobs aren&amp;rsquo;t processed immediately by the system, they are put in
holding status and are placed in a seperate queue (the Apex Flex queue). You can have up to 100 batch jobs in the holding status. When system resources
are available the system will move the job from flex queue to the batch job queue by changing the status from &amp;lsquo;Holding&amp;rsquo; to &amp;lsquo;Queued&amp;rsquo;.
The jobs are processed first-in first-out by default, but Administrators also have the option to modify the order of jobs held in the Apex Flex queue.&lt;/p&gt;

&lt;p&gt;These are some of my favourite features. If you have a favourite feature(s) list it/them in the comments.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2014/06/25/return-statement-in-finally</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2014/06/25/return-statement-in-finally"/>
    <title>To return or not to return</title>
    <published>2014-06-25T00:00:00+00:00</published>
    <updated>2014-06-25T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;Apex allows you to handle Exceptions using the &lt;code&gt;try-catch-finally&lt;/code&gt; block. The documentation states that the &lt;code&gt;Finally&lt;/code&gt; block always gets executed.
The documentation also says that when the compiler encounters the &lt;code&gt;Return&lt;/code&gt; statement it will instantly return the control back to the calling function/block.
But when you use (or in this case misuse) the two constructs together you see some interesting and surprising results.&lt;/p&gt;

&lt;p&gt;Consider the following code below. Pretend to be a compiler for a moment and predict the outcome in the final System.debug() statement.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FinallyReturnTest&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Function returns from the finally block&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;returnAString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Will throw null pointer exception&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// the exception will be caught&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;caught&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;is:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;I&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;am&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Catch&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;finally&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;I&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;am&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Finally&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;I&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;am&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;returnVar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Execution will never reach this statement&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;  
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;// Instantiate the class and call the method&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;// from anonymous apex &lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;FinallyReturnTest&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;frtInstance&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;FinallyReturnTest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;The&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;is:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;frtInstance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;returnAString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The odd thing about this code is &lt;em&gt;not&lt;/em&gt; that it has more &lt;code&gt;Return&lt;/code&gt; statements than Homer Simpson has hair on his head.
If you were expecting the outcome to be &lt;code&gt;The return string is: I am set in the Catch block.&lt;/code&gt;, then you are in for a surprise.&lt;/p&gt;

&lt;p&gt;The actual outcome is - &lt;code&gt;The return string is: I am set in the Finally block.&lt;/code&gt;. Yep, they were not kidding when they said that
the &lt;code&gt;Finally&lt;/code&gt; block will always get executed. Even overriding the nature of the &lt;code&gt;Return&lt;/code&gt; statement in the &lt;code&gt;Catch&lt;/code&gt; block.&lt;/p&gt;

&lt;p&gt;I would argue that it is generally a bad practice to return from a &lt;code&gt;Catch&lt;/code&gt; or &lt;code&gt;Finally&lt;/code&gt; block and you shouldn&amp;rsquo;t do it. But if you
do decide to return from these blocks then be aware of this idiosyncracy. Since apex is &amp;ldquo;modelled&amp;rdquo; (and I use the term modelled very loosely here)
on Java, I decided to test this in Java and &lt;em&gt;voila&lt;/em&gt; I could replicate this in Java as well.&lt;/p&gt;

&lt;p&gt;Before you return to your daily routine, here is some food for thought. If I modify the code slightly by commenting out the return
in the &lt;code&gt;Finally&lt;/code&gt; block then the outcome is as expected - &lt;code&gt;The return string is: I am set in the Catch block.&lt;/code&gt;. That is, it now returns from
the &lt;code&gt;Catch&lt;/code&gt; block. Go figure!&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2013/12/22/bootstrap-and-visualforce</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2013/12/22/bootstrap-and-visualforce"/>
    <title>Using Bootstrap with Visualforce</title>
    <published>2013-12-22T00:00:00+00:00</published>
    <updated>2013-12-22T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;If you spend your time building web apps then you might be familiar with &lt;a href=&quot;http://getbootstrap.com&quot;&gt;Bootstrap&lt;/a&gt;, a powerful front-end
toolkit for rapidly developing web applciations. It was orginally created by &lt;a href=&quot;https://dev.twitter.com&quot;&gt;Twitter&lt;/a&gt;, and has since then been &lt;a href=&quot;https://github.com/twbs&quot;&gt;open-sourced&lt;/a&gt;
and maintained by the core team along with community.&lt;/p&gt;

&lt;p&gt;With its nifty collection of CSS and HTML conventions, it provides the developer with some stylish typography, forms, buttons, tables,
grids, navigation etc. by using CSS reset along with other common layout features. Bootstrap 3 is responsive(layout graciously adapts to different
screen sizes) by default with a mobile first approach.&lt;/p&gt;

&lt;p&gt;I wanted to wield the power of this powerful framework on my Visualforce page so I began tinkering with it. It turns out that Visualforce and
Bootstrap work very well together. I have posted a snapshot of the code and some screenshots below.&lt;/p&gt;

&lt;p&gt;You can find the source code on my github page &lt;a href=&quot;https://gist.github.com/anupj/8089606&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The code below describes the main components to be included for the framework.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:page&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;showHeader=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;sidebar=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;standardStylesheets=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;docType=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;html-5.0&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;language=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;en-US&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;applyHTMLTag=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;en&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;charset=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Anup&amp;#39;s Bootstrap example&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;viewport&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Bootstrap --&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!URLFOR($Resource.Bootstrap_3_0_3, &amp;#39;dist/css/bootstrap.min.css&amp;#39;)}&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;

      &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- WARNING: Respond.js doesn&amp;#39;t work if you view the page via file:// --&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if lt IE 9]&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;        &amp;lt;script src=&amp;quot;https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;        &amp;lt;script src=&amp;quot;https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;      &amp;lt;![endif]--&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- jQuery (necessary for Bootstrap&amp;#39;s JavaScript plugins) --&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;https://code.jquery.com/jquery.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Include all compiled plugins (below), or include individual files as needed --&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:includeScript&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!URLFOR($Resource.Bootstrap_3_0_3, &amp;#39;dist/js/bootstrap.min.js&amp;#39;)}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/apex:includeScript&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Please note that the &amp;lsquo;applyHTMLTag&amp;rsquo; is set to &lt;em&gt;false&lt;/em&gt; because we are statically inserting our own html, head and body tags.
Also, the docType is set to &amp;lsquo;html-5.0&amp;rsquo;, so the page will have the HTML5 docType. I have tried this with other docTypes with
mixed results so I wouldn&amp;rsquo;t recommend it.&lt;/p&gt;

&lt;p&gt;Sample code to display the navigation bar.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;navbar navbar-inverse navbar-fixed-top&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;layout=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;block&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;html-role=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;navigation&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;container&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;layout=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;block&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;navbar-header&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;layout=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;block&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;button&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;navbar-toggle&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;data-toggle=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;collapse&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;data-target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;.navbar-collapse&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;sr-only&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Toggle navigation&lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;icon-bar&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;icon-bar&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;icon-bar&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;navbar-brand&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;#&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Salesforce1 and Bootstrap&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;navbar-collapse collapse&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;layout=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;block&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;form&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;navbar-form navbar-right&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;role=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;form&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;form-group&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;layout=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;block&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
              &lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;placeholder=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Email&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;form-control&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;form-group&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;layout=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;block&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
              &lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;password&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;placeholder=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Password&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;form-control&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;btn btn-success&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Sign in&lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;&lt;span class=&quot;c&quot;&gt;&amp;lt;!--/.navbar-collapse --&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Some screenshots of the final Visualforce page with Bootstrap framework applied.&lt;/p&gt;

&lt;p&gt;  &lt;img src=&quot;/images/vfbootstrap.png&quot; class=&quot;img-responsive img-rounded&quot; width=&quot;100%&quot; style=&quot;border:2px solid #fee;&quot; alt=&quot;Bootstrap Example Desktop&quot; /&gt;&lt;/p&gt;

&lt;p&gt;  &lt;img src=&quot;/images/vfbootstrapmobile.png&quot; class=&quot;img-responsive img-rounded&quot; alt=&quot;Bootstrap Example Mobile&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gist.github.com/anupj/8089606&quot;&gt;Source Code&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2013/12/21/partner-wsdl-create</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2013/12/21/partner-wsdl-create"/>
    <title>Create multiple sObjects with one create() call</title>
    <published>2013-12-21T00:00:00+00:00</published>
    <updated>2013-12-21T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;I have been playing with the partner wsdl a lot lately. One of the things that I was trying to do was to create an Account,
Contact and Opportunity object with one create() call to avoid calling the api multiple times.&lt;/p&gt;

&lt;p&gt;After some digging I came across the create() &lt;a href=&quot;http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_create.htm&quot;&gt;api documentation&lt;/a&gt; that has a very good example of how you can create an Account and Opportunity using external id.
I wrote the following the code the inserts all three objects with one create() call. Hope this helps some intrepid developer who is trying to do something similar.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Create the connection object&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ConnectorConfig&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;connector&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;ConnectorConfig&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;connector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setUsername&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;connector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setPassword&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;connector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setAuthEndpoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;endpoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;PartnerConnection&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sourceConnection&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;PartnerConnection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;connector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// Set the allOrNone header to true to make the call atomic&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;__header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setAllOrNone&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sourceConnection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;__setAllOrNoneHeader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;__header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// Create the SObjects array   &lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SObject&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sObjects&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SObject&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;
        
    &lt;span class=&quot;c1&quot;&gt;// Create Account sObject&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SObject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parentAccount&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SObject&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;parentAccount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Account&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; 
    &lt;span class=&quot;n&quot;&gt;parentAccount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;TestAccount1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;parentAccount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;AcctExtId__c&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ACCT EXTID 1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sObjects&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parentAccount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// parent account reference - set the ext id same as above&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SObject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parentAccountRef&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SObject&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;parentAccountRef&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Account&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;parentAccountRef&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;AcctExtId__c&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ACCT EXTID 1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// Create Contact sObject&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SObject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;childContact&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SObject&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childContact&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Contact&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; 
    &lt;span class=&quot;n&quot;&gt;childContact&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;TestContact1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childContact&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;ContExtId__c&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;CONT EXTID 1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// Assign the Account field to the account ref&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childContact&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Account&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parentAccountRef&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sObjects&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;childContact&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// Create Opportunity sObject&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SObject&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;childOpp&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SObject&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childOpp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Opportunity&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childOpp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;TestOpportunity1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Calendar&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dt&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sourceConnection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getServerTimestamp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getTimestamp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Calendar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;DAY_OF_MONTH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childOpp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;CloseDate&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childOpp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;StageName&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Prospecting&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childOpp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;OppExtId__c&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;OPP EXTID 1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;childOpp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setField&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Account&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parentAccountRef&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;sObjects&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;childOpp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// call the create method&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;SaveResult&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sourceConnection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sObjects&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// log the output&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;isSuccess&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;logger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;sobject was created with an ID of: &amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
       &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;c1&quot;&gt;// There were errors during the create call,&lt;/span&gt;
          &lt;span class=&quot;c1&quot;&gt;// go through the errors array and write&lt;/span&gt;
          &lt;span class=&quot;c1&quot;&gt;// them to the console&lt;/span&gt;
          &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getErrors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
              &lt;span class=&quot;n&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;err&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;results&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getErrors&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;
              &lt;span class=&quot;n&quot;&gt;logger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Errors were found on item &amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
              &lt;span class=&quot;n&quot;&gt;logger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Error code: &amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getStatusCode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
              &lt;span class=&quot;n&quot;&gt;logger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Error message: &amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
          &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
       &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Some things to note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can only insert objects one level deep with a single create() call. You can insert Account and Opportunity, but you cannot insert
Account, Opportunity, and OpportunityLineItem with one call.&lt;/li&gt;
&lt;li&gt;This method relies on external ids but you are only allowed upto 3 external ids per object so design your objects carefully.&lt;/li&gt;
&lt;li&gt;This strategy only works with the create() method. The upsert() method requires you to insert an array of sObjects of a single type.&lt;/li&gt;
&lt;li&gt;It will also work with the update() method if you set the id value of the sobjects. It doesn&amp;rsquo;t work with external ids. This requires you to make a query to
your salesforce org to retrieve the ids before creating the sObject array.&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2013/12/08/convert-salesforce-id-java</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2013/12/08/convert-salesforce-id-java"/>
    <title>Convert Salesforce id in Java</title>
    <published>2013-12-08T00:00:00+00:00</published>
    <updated>2013-12-08T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;I am working on a project which requires integrating with Force.com via the SOAP wsdl. One of the things that we want to
ensure is that we always work with 18 character ids. The SOAP api always returns 18 character ids, but the input to the
java app could be a csv file which may contain 15 character ids.&lt;/p&gt;

&lt;p&gt;I created the following utility method in Java that converts 15 character id to 18 character id. The logic for the code was derived
from this &lt;a href=&quot;http://salesforce.stackexchange.com/questions/1653/what-are-salesforce-ids-composed-of&quot;&gt;Salesforce StackExchange post&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Converts 15 char salesforce id to 18 char id&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;convertto18CharId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;original15charId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;){&lt;/span&gt;
    
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;original15charId&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;original15charId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;isEmpty&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;original15charId&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;original15charId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;trim&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;original15charId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    
    &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;BASE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;StringBuilder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    
    &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++){&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;StringBuilder&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tempString&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;StringBuilder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;original15charId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;substring&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;tempString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;reverse&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;binary&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;ch:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tempString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toCharArray&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;binary&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Character&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;isUpperCase&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;sc&quot;&gt;&amp;#39;1&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sc&quot;&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BASE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;charAt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;binary&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)));&lt;/span&gt; 
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;n&quot;&gt;ex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;original15charId&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2013/03/11/salesforce-CI-bamboo-jira</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2013/03/11/salesforce-CI-bamboo-jira"/>
    <title>Continuous Integration on the Force.com platform using Git, Bamboo, &amp; JIRA</title>
    <published>2013-03-11T00:00:00+00:00</published>
    <updated>2013-03-11T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;When we develop applications on the Force.com platform we perform a lot of activities to create, test and ship
our code. We repeatedly carry out tasks like &lt;strong&gt;Run All Tests&lt;/strong&gt; to ensure that the code that we have just committed to
the repository does not break the build. This may involve (repeatedly) deploying your code to a QA org, and running all tests
on that org. These activities are not only time consuming but also repetitive and soon become boring as you re-iterate
this cycle for every code commit.&lt;/p&gt;

&lt;p&gt;I am a big proponent of automating developer workflows to improve productivity and to reduce
the cognitive effort required to develop and ship software by automating repetitive tasks where possible. Techniques such as
Automated testing, &lt;a href=&quot;http://www.martinfowler.com/articles/continuousIntegration.html&quot;&gt;Continuous Integration&lt;/a&gt;, and Continuous Deploy enable Continuous Delivery - a desirable model to
deliver software in the modern Agile world.&lt;/p&gt;

&lt;p&gt;Thankfully, it is possible to streamline Force.com development by automating almost all of these tasks, and this article will describe
one way of adding Continuous Integration to your dev setup using &lt;a href=&quot;http://git-scm.com&quot;&gt;Git&lt;/a&gt;, &lt;a href=&quot;http://jira.com&quot;&gt;JIRA&lt;/a&gt;, and &lt;a href=&quot;http://www.atlassian.com/software/bamboo/overview&quot;&gt;Bamboo&lt;/a&gt;. This article assumes
that the reader has some familiarity with these technologies. We will be using &lt;a href=&quot;http://bitbucket.org&quot;&gt;Bitbucket&lt;/a&gt; to host our Git repository&lt;/p&gt;

&lt;p&gt;Follow these steps to set up Continuous Integration with Git, JIRA and Bamboo.&lt;/p&gt;

&lt;h2&gt;Step 1: Setup your Git repository on Bitbucket&lt;/h2&gt;

&lt;hr /&gt;

&lt;ul&gt;
&lt;li&gt;Log into your Bitbucket account, and create a new repository.&lt;/li&gt;
&lt;li&gt;Follow the instructions in Bitbucket to clone the repository on your machine.&lt;/li&gt;
&lt;li&gt;Add some code to your local repository, and push the commit to the bitbucket (remote origin) repository.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I chose Bitbucket because it has inbuilt hooks to integrate with JIRA.&lt;/p&gt;

&lt;h2&gt;Step 2: Associate your JIRA project with Bamboo&lt;/h2&gt;

&lt;hr /&gt;

&lt;p&gt;To complete this step you will need a Bamboo feature license in JIRA.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new JIRA project (if you don&amp;rsquo;t already have one).&lt;/li&gt;
&lt;li&gt;After you have set up the project, click on &amp;ldquo;Administer Project&amp;rdquo; to go to the project administration page.&lt;/li&gt;
&lt;li&gt;Under the Settings section, select the &amp;ldquo;Bamboo Project&amp;rdquo;. You will be directed to the &amp;ldquo;Associate a Bamboo Project&amp;rdquo; page
where you can assign an &amp;ldquo;instance&amp;rdquo; and enter the Bamboo project key.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt; &lt;img src=&quot;/images/gitjira-img1.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt; &lt;img src=&quot;/images/gitjira-img2.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Basically, this step links your JIRA project with your Bamboo project.&lt;/p&gt;

&lt;h2&gt;Step 3: Link Bitbucket to JIRA&lt;/h2&gt;

&lt;hr /&gt;

&lt;p&gt;In this step you will link the Bitbucket repository to the the JIRA project. This means that every time you commit some
code to the Git repository and insert the JIRA task ticket number in the commit comment, the commit information will be displayed
in the Commits tab under the Activity section.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to your repository settings in Bitbucket  and click on Links.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img3.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then, click on the Atlassian Jira icon under &amp;ldquo;Add a new link&amp;rdquo;, and enter following details.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img4.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bitbucket is now linked to JIRA. If you commit your changes with the JIRA ticket number, your commits will
appear against the JIRA ticket in the Commits tab under the Activity section.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img5.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;h2&gt;Step 4: Setup Bamboo in JIRA&lt;/h2&gt;

&lt;hr /&gt;

&lt;p&gt;In this step we configure Bamboo and create a build Plan that Bamboo will execute to checkout the code from
BitBucket and deploy it to the CI org and Run All Tests.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log into JIRA again, and click on the Atlassian Bamboo Admin link in the main settings drop down menu.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img6.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On the Atlassian Bamboo Admin page, configure Elastic Bamboo by adding the AWS Access Key ID and updating
Elastic Bamboo Global Settings. Read the Bamboo documentation for more information
on how to set up Elastic Bamboo. Setting up AWS instances is out of scope of this article.&lt;/li&gt;
&lt;li&gt;Once Elastic Bamboo is configured and linked to AWS instance(s), you are now ready to create a Plan for your project.&lt;/li&gt;
&lt;li&gt;A plan defines everything about your build process, including what gets built, how the Build is triggered and what
jobs are executed.&lt;/li&gt;
&lt;li&gt;Click on the Create Plan button to go to the Plan wizard page, and then click on the &amp;ldquo;Create a New Plan&amp;rdquo; link.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img7.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img8.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter Plan details like Plan Name and Plan Key. If the project does not exist in the drop down list then select the new project option
and enter the Project Name and Key.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img9.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter Source Repository information&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img10.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter Trigger details like Trigger type, Polling Strategy, and Polling Frequency. This determines how and when the job should poll the repository. In this case we are
requesting the job to poll the repository for changes every 30 sec.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img11.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complete the process by clicking on &amp;ldquo;Configure Tasks&amp;rdquo; which takes you to the Configure Tasks wizard page where you can add tasks to the plan
that will be executed in the desired order.&lt;/li&gt;
&lt;li&gt;You should now see the Source Code Checkout task automatically added for you. Click Add Task to add the build task.&lt;/li&gt;
&lt;li&gt;Since we will be using the Force.com migration toolkit which is based on Ant, you need to add the Ant task from
the list.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img12.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter the Ant Task details as shown below. The Target is the ant task that will be run by this job, and the Build
File is the location of the build.xml file stored in the repository.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img13.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;[EDIT: One of the readers rightly pointed out that the &amp;ldquo;Build File&amp;rdquo; entry above should be build/build.xml, and &amp;ldquo;Target&amp;rdquo;
entry should be deployPackaged instead of buildCI]&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We have now created a Plan in Bamboo that will checkout the code from our Bitbucket repository when it changes (i.e.
when we commit and push something to the repository), run the ant task that will deploy the code to the CI org and runs all tests.
The CI org details are listed in the &lt;strong&gt;build.properties&lt;/strong&gt; file and deploy and run all tasks are defined in the &lt;strong&gt;build.xml&lt;/strong&gt; file.&lt;/p&gt;

&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img14.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;h2&gt;Step 5: Add build.properties and build.xml to the repository&lt;/h2&gt;

&lt;hr /&gt;

&lt;p&gt;You have setup a Bitbucket repository, linked it to a JIRA project, and created a Plan in Bamboo that checks out the code
from Bitbucket and added an ant task to run the build.xml file. The next step is obviously to write the build.xml file and
add it to the repository.&lt;/p&gt;

&lt;p&gt;Add a buid directory to your root project directory that will hold the build.xml and related build.properties and Migration toolkit jar file(inside lib
folder) as shown below. This structure will keep the src and the top-most folder clean.&lt;/p&gt;

&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img15.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img16.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;  &lt;img src=&quot;/images/gitjira-img17.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The build.properties file contains your username, password, server url for the CI org.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;# The password is all that should be changed in normal circumstances
sf.username = &lt;span class=&quot;nt&quot;&gt;&amp;lt;username&amp;gt;&lt;/span&gt;
sf.password = &lt;span class=&quot;nt&quot;&gt;&amp;lt;password&amp;gt;&lt;/span&gt;

# Setup polling params
sf.maxPoll = 500
sf.maxWaitMillis = 5000

# More optional params
# sf.pkgName = &lt;span class=&quot;nt&quot;&gt;&amp;lt;Insert&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;comma&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;separated&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;names&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;be&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;retrieved&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
# sf.zipFile = &lt;span class=&quot;nt&quot;&gt;&amp;lt;Insert&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;zipfile&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;be&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;retrieved&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
# sf.metadataType = &lt;span class=&quot;nt&quot;&gt;&amp;lt;Insert&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;metadata&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;which&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;listMetadata&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;bulkRetrieve&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;operations&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;are&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;be&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;performed&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;

sf.serverurl = https://login.salesforce.com

# If your network requires an HTTP proxy, see http://ant.apache.org/manual/proxy.html for configuration.&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The build.xml file contains the target and tasks which will deploy the code to a CI org using the credentials from
build.properties, and run all tests.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;ACM&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;basedir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;..&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;xmlns:sf=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;antlib:com.salesforce&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;taskdef&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;uri=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;antlib:com.salesforce&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;resource=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;com/salesforce/antlib.xml&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;classpath=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${basedir}/build/lib/ant-salesforce.jar&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
    
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;file=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${basedir}/build/build.properties&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;environment=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;env&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;lib.dir&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${basedir}/lib&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;src.dir&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${basedir}/src&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;cleanAfter&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;depends=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;deployPackaged&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;echo&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;level=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;info&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Clean Down Workspace Ready for Next Build&lt;span class=&quot;nt&quot;&gt;&amp;lt;/echo&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;delete&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;dir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${basedir}&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;failonerror=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;delete&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;includeEmptyDirs=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;failonerror=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;fileset&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;dir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${basedir}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/delete&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;
    
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;deployPackaged&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;   
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;echo&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;level=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;info&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Perform a Deploy transaction&lt;span class=&quot;nt&quot;&gt;&amp;lt;/echo&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;zip&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;destfile=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${src.dir}/batch.zip&amp;quot;&lt;/span&gt;
           &lt;span class=&quot;na&quot;&gt;basedir=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${src.dir}&amp;quot;&lt;/span&gt;
                 &lt;span class=&quot;na&quot;&gt;includes=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;applications/*.*, classes/*.*, staticresources/*.*,documents/**/*.*, email/**/*.*, labels/*.*, objects/*.*, workflows/*.*, pages/*.*, components/*.*, tabs/*.*, letterhead/*.*, triggers/*.*, layouts/*.*, reports/**/*.*, profiles/*.*, package.xml&amp;quot;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;

      &lt;span class=&quot;nt&quot;&gt;&amp;lt;sf:deploy&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;username=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${sf.username}&amp;quot;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;password=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${sf.password}&amp;quot;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;serverurl=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${sf.serverurl}&amp;quot;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;maxPoll=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${sf.maxPoll}&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;pollWaitMillis=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${sf.maxWaitMillis}&amp;quot;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;zipFile=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;${src.dir}/batch.zip&amp;quot;&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;runalltests=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;/sf:deploy&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;   
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This is a very basic build.xml file, but you can extend it to add builds for different orgs, and can add tasks that
trigger other tests like Selenium scripts.
If you now run the Bamboo Task from JIRA it should run your build, and if it is successful, the build run info will also be
listed against the JIRA ticket that was used in the latest code commit in the Build tab under the Activity setion.&lt;/p&gt;

&lt;p&gt;You can also (optionally) enable notification on your Bamboo Plan inside JIRA to send you or a group of users an
email whenever a build succeeds or fails.&lt;/p&gt;

&lt;p&gt;Let me know in the comments if you want me to elaborate or explain a step in more detail, and I&amp;rsquo;ll be more than happy
to help.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2013/02/18/salesforce-knowledge</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2013/02/18/salesforce-knowledge"/>
    <title>Salesforce Knowledge vs Solutions</title>
    <published>2013-02-18T00:00:00+00:00</published>
    <updated>2013-02-18T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;One of the frequent questions on the Developer Boards and on the Salesforce Stackexchange sites is -
What is the difference between Solutions and Knowledge?&lt;/p&gt;

&lt;p&gt;I found this neat little comparision chart in one of the service cloud training videos that shows the main differences
between Solutions and Knowledge.&lt;/p&gt;

&lt;p&gt;  &lt;img src=&quot;/images/knowledge.jpg&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Posting here for future reference.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2013/02/16/mac-show-hidden-file</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2013/02/16/mac-show-hidden-file"/>
    <title>Pro-tip - Show Hidden Folder in Finder</title>
    <published>2013-02-16T00:00:00+00:00</published>
    <updated>2013-02-16T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;Recently, I wanted to install a new stencil for Omnigraffle, and the suggested
installation folder was &lt;strong&gt;~/Library/Application Support/OmniGraffle/Stencils&lt;/strong&gt; directory.
So, I proceeded to download the stencil zip file in my &lt;strong&gt;Downloads&lt;/strong&gt; folder, and opened
Finder to move the file from the &lt;strong&gt;Downloads&lt;/strong&gt; folder to the suggested folder, and to my
surprise I couldn&amp;rsquo;t find the &lt;strong&gt;Library&lt;/strong&gt; folder anywhere in my home directory in Finder.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://i.imgur.com/1za9rY5.jpg?1&quot; alt=&quot;hidden&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I realized that &lt;strong&gt;Library&lt;/strong&gt; is a hidden folder and is not displayed by default in Finder, but
I couldn&amp;rsquo;t figure out how to display and access this folder in Finder. Now, I could have
used the terminal and just copied the file using the cp command, but I wanted to know if I
can do this using Finder. So I used Google-fu to find the solution to this problem, and to
my amazement the solution is clunky at best, and unintuitive at worst. So, to access the hidden
folder, you have to open Finder, and select the relevant parent folder that contains the
hidden folder. In my case the hidden folder Library was inside my home directory, so I
selected the home directory. Then select the &lt;strong&gt;Go&lt;/strong&gt; option in the Finder menu bar, and click
&lt;strong&gt;alt&lt;/strong&gt;(also called Option ⌥) key to show the hidden folder(s).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://imgur.com/yFfjJl5.jpg?1&quot; alt=&quot;hidden&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Isn&amp;rsquo;t Mac supposed to be user-friendly for non-technical folks?&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2013/02/01/jquery-autocomplete</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2013/02/01/jquery-autocomplete"/>
    <title>You Autocomplete Me - Visualforce+jQuery UI</title>
    <published>2013-02-01T00:00:00+00:00</published>
    <updated>2013-02-01T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;img src=&quot;http://i.imgur.com/SzEYfMr.gif&quot; alt=&quot;Demo&quot; /&gt;&lt;/p&gt;

&lt;p&gt;One of the most common functionalities of a typical web application or website is the ability to search for
things on the site. In the old days, it was sufficient to provide a simple text box where the user can
enter the key word or a phrase to search. The latest paradigm, however, is to add some kind of auto-suggest or
auto-complete capability to the search text box that predicts one or more possible words or statements and displays in a list,
when the user writes the first letter or letters of the word in the box. If the intended word or statement is displayed as
one of the options in the list, then the user will select the word or statement. This is a very useful feature
that leads to less typing, and better directed search thereby improving the overall user experience.&lt;/p&gt;

&lt;p&gt;As a Visualforce developer, you would definitely want to harness the awesomeness of this nifty feature to improve
your websites user experience. You can also replace that uncool drop down list containing 500 items which is difficult if not
impossible to navigate, with a search box and a baked-in auto-suggest feature. This post will demonstrate how to implement the
auto-complete (or auto-suggest) functionality using Visualforce and jQuery UI. I assume that you are comfortable with both Visualforce
and jQuery. If you are still new to both of these technologies, I would recommend reading a bit about them before proceeding.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s say you are building a Visualforce page that allows users to search for their favourite movie and rent it (ala Netflix). You
also want to help the user to search for the right movie, by automatically suggesting the movie name as they type it in the
search box. Create a visualforce page called &lt;code&gt;AutoComplete.page&lt;/code&gt; and the corresponding controller &lt;code&gt;AutoCompleteController.cls&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The first step is to add jquery.js, jquery-ui.js, and jquery-ui.css to the header.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;# AutoComplete.page
&lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:includeScript&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:includeScript&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:styleSheet&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/smoothness/jquery-ui.css&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then add an apex form component that contains the search text box.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;# AutoComplete.page
&lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:form&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;autoCompleteForm&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
        
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:pageBlock&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;searchBlock&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:pageBlockSection&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;searchSection&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;title=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Find me a movie to rent&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;columns=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputLabel&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Movie Name&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;for=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;movieBox&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:outputPanel&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
                 &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:inputText&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;movieTextBoxId&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!searchTerm}&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;styleClass=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;placeHolder&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
                 &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:inputHidden&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;searchMovieId&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!selectedMovie}&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:outputPanel&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:pageBlockSection&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:pageBlock&amp;gt;&lt;/span&gt;
    
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:form&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The form component contains a pageBlockSection component inside a pageBlock component that consists of an outputPanel and outputText
component. There is also an inputHidden component inside the outputPanel component that will be used to store the movie name selected
from the list. Please note that all of the components have an id attribute.&lt;/p&gt;

&lt;p&gt;Then add this script at the bottom of the page.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;# AutoComplete.page
&lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PLACEHOLDER&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Enter Movie Name Here&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;movieObjects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;queryTerm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    
    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;[id$=movieTextBoxId]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;autocomplete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;minLength&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;nx&quot;&gt;queryTerm&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;term&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;nx&quot;&gt;AutoCompleteController&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;searchMovie&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;term&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
                        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;exception&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                              &lt;span class=&quot;nx&quot;&gt;alert&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                             &lt;span class=&quot;nx&quot;&gt;movieObjects&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                             &lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;movieObjects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
                    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
               &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;focus&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ui&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;[id$=movieTextBoxId]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ui&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ui&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;[id$=movieTextBoxId]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ui&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;[id$=searchMovieId]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ui&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Id&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
     &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
     &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;autocomplete&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_renderItem&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ul&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;entry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;lt;a&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
       
        &lt;span class=&quot;nx&quot;&gt;entry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;entry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;entry&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;entry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;queryTerm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;lt;b&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;queryTerm&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;lt;/b&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;item.autocomplete&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;item&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;entry&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;appendTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ul&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
        
    &lt;span class=&quot;c1&quot;&gt;// Add or remove placeholder values&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;[id$=movieTextBoxId]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;PLACEHOLDER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;[id$=movieTextBoxId]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;focus&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;$tgt&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$tgt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PLACEHOLDER&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;$tgt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;$tgt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;removeClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;placeHolder&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;[id$=movieTextBoxId]&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;blur&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;$tgt&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;target&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$tgt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;$tgt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;PLACEHOLDER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;$tgt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;placeHolder&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The magic happens in the autocomplete() method provided by jQuery-UI. You can find the complete documentation &lt;a href=&quot;http://jqueryui.com/autocomplete/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The controller is very simple, and contains a single remote action method searchMovie() that retrieves the list of movie from the
database that is dynamically displayed in the dropdown list.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// AutoCompleteController.cls&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sharing&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;AutoCompleteController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    
    &lt;span class=&quot;c1&quot;&gt;// Instance fields&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;searchTerm&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;}&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;selectedMovie&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;}&lt;/span&gt;
    
    &lt;span class=&quot;c1&quot;&gt;// JS Remoting action called when searching for a movie name&lt;/span&gt;
    &lt;span class=&quot;nd&quot;&gt;@RemoteAction&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Movie__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;searchMovie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;searchTerm&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Movie&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;is:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;searchTerm&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Movie__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;movies&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Database&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Name&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Movie__c&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;where&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;like&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;sc&quot;&gt;&amp;#39;%&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;escapeSingleQuotes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;searchTerm&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;\&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;movies&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You would also have to add the following css for the correct look and feel.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;style&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;.displayNone&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;.displayBlock&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;.ui-autocomplete-loading&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;white&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(/img/loading32.gif)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;right&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;center&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;no-repeat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;.placeHolder&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;italic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Finally, a screenshot of autoComplete feature in action.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://i.imgur.com/HpDLdCJ.png&quot; alt=&quot;Demo&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You can view the sample source code on my &lt;a href=&quot;https://github.com/anupj/Visualforce-jQuery&quot;&gt;github page&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2013/01/16/salesforce-adoption</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2013/01/16/salesforce-adoption"/>
    <title>How to improve Salesforce.com adoption</title>
    <published>2013-01-16T00:00:00+00:00</published>
    <updated>2013-01-16T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://xkcd.com/724/&quot;&gt;&lt;img src=&quot;http://i.imgur.com/wJ6Xp8V.png&quot; title=&quot;Impossible Tetris&quot; alt=&quot;xkcd tetris&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Salesforce.com is a very powerful and flexible CRM &amp;lsquo;Software as a Service&amp;rsquo; platform. It provides a lot of
functionality out of the box to support and enhance the sales, marketing, service and support functions
within your business. Despite the complexity and richness of features, it is very easy to implement the
system initially with minimal setup and configuration. They focus mostly on implementation aspects, tend to
ignore the processes that will help improve the adoption of the system post-implementation. Because of this
big organizations which are spread globally and have a complex vertical and horizontal business structure
struggle to increase adoption of Salesforce after the initial implementation. It becomes increasingly
difficult to incentivise users to use Salesforce regularly in a correct fashion encourage them to create and
curate data in the salesforce org.&lt;/p&gt;

&lt;p&gt;Some of the main reasons for low adoption are inferior data quality due to lack of governance process
and data quality tools, complex page layouts and workflows that confuse the users and diminish user
experience, lack of incentives to use the system, lack of training to newbies, lack of global business
and governance process etc. If this problem is not nipped in the bud, then the system is ignored and
the value derived per license goes down. Even worse, it grows organically in an incoherent fashion
which leads to a mishmash of poor configuration, inefficient security setup, redundant data, and
untracked, unorganised metadata and code. All of this leads the business to believe that they are not
getting value for money for their salesforce implementation and scramble to either get rid of
Salesforce or try to fix it by overhauling the whole system which is an expensive endeavour. Does this
scenario sound familiar to you?&lt;/p&gt;

&lt;p&gt;The purpose of this post is to provide some guidance and practical advice to help mitigate some of the
issues, and improve the momentum of the adoption within your company.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Perform a health check of your current implementation. Before you can fix a problem, you need to
 understand the nature and size of the problem. Do an honest assessment of your current system, and
 document it. It is important that you capture both good and bad(especially bad) parts of your system
 in the report. List down the steps to fix your system and business processes to align it with
 industry best practice. This exercise will not only help you outline the problem but also create a
 roadmap with a practical strategy, timeline and cost to fix the problem. To get a business buy-in
 its important to demonstrate the cost-benefit trade-off of continuing to work as is versus the long
 term benefits of fixing the problem right now.&lt;/li&gt;
&lt;li&gt; Ensure that you have the resources to see through the proposed changes, and that the business users
 are closely involved in the implementation process. They should be involved in shaping the solution,
 in performing Quality Assurance and user testing, and providing feedback during the lifecycle of the project. In other words,
 be as &amp;ldquo;agile&amp;rdquo; as possible. Make sure that there is a massive focus on user experience and training
 users. The training should be tailored to teach actions and flows that are aligned with your business
 process and industry best practice. For e.g. instead of just showing them how to convert a lead into account
 and contact, walk them through the lead qualification process explaining when to convert a lead, and what
 information to change/update in the newly created account/contact/opportunity. Explaining the why along with the
 what and the how will help the user understand the rationale behind each step.&lt;/li&gt;
&lt;li&gt; Build and nurture a team of dedicated Salesforce administrators, developers, and Data Quality
 Champions. The Data Quality Champions are responsible for monitoring and curating the data in
 Salesforce. They can be existing business users who are able to take on additional responsibilities
 or dedicated Business Analysts who are accountable for data.&lt;/li&gt;
&lt;li&gt; Build a positive culture around adoption. The system should not be a burden to use. Listen to your
 users feedback and identify pain points both in the system and the process that you can fix to
 improve the user experience and adoption.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;These actions are admittedly easier said than done, and some or all of it might potentially be expensive in the short term,
but the long term benefits far outweigh the immediate cost. You can break down the problem into smaller pieces and try to fix them one at a time instead of fixing
it all at once. Regardless of your approach, it requires commitment and drive from both the business and the
IT team, and can be an uphill struggle. However, it is worth the effort if you&amp;rsquo;d like to increase the value
derived per license, and exploit the capabilities of this platform to the full extent.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2012/06/23/grokking-force-1</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2012/06/23/grokking-force-1"/>
    <title>Grokking Force.com - Apex</title>
    <published>2012-06-23T00:00:00+00:00</published>
    <updated>2012-06-23T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;Over the past few years, as a &lt;a href=&quot;http://developer.force.com&quot;&gt;Force.com&lt;/a&gt; developer, I have come across quite a few interesting features and gotchas
on the Force.com platform that are either not documented, or is documented but developers don&amp;rsquo;t know about it.
This post describes some of the quirks and some unknown facts of the Apex language that you might or might not have seen.
Let&amp;rsquo;s dive in!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Map accepts &lt;code&gt;null&lt;/code&gt; as a key&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;According to the &lt;a href=&quot;http://www.salesforce.com/us/developer/docs/apexcode/index.htm&quot;&gt;Apex docs&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;A map is a collection of key-value pairs where each unique key maps to a single 
value. Keys can be any primitive data type, while values can be primitive, 
sObject, collection type or an Apex object.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And right at the bottom of the page, it also notes:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;A map key can hold the null value
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So the following code is a perfectly legitimate apex code:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;n&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;testMap&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;();&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;testMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;foobar&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

 &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;is:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;testMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt; 
 &lt;span class=&quot;c1&quot;&gt;//outputs: The value of the null key is: foobar&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Allowing &lt;code&gt;null&lt;/code&gt; as a key to a map is a design flaw IMHO, therefore, it is a good idea to check for null before adding
the key to a map variable. This information is also useful if you are wondering, why your map is returning null values?!?,
when it&amp;rsquo;s not supposed to, especially, when you instatiate a map with a SOQL result where the values returned can be
null unless you explicity check for null values in the where clause.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unit Tests increment your Objects unique Id&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is not covered in the documentation, or atleast I haven&amp;rsquo;t found it in the Apex docs. When you run unit
tests that insert/create records for a particular object(standard or otherwise), it increments the value of
the Name field(of type Auto Number) outside of the test context.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s say you have a custom object &amp;ldquo;Invoice Statement&amp;rdquo; (Invoice_Statement__c) that has a Name field called
&amp;ldquo;Invoice Number&amp;rdquo;, and is of type &amp;ldquo;Auto Number&amp;rdquo;. The format of the field is: INV-{0000}, and let&amp;rsquo;s assume that
the latest record number is INV-2058.&lt;/p&gt;

&lt;p&gt;If you insert 10 records in the test class as follows:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// Let&amp;#39;s assume that this runs inside of a test method&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Invoice_Statement__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;invStatementList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Invoice_Statement__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;();&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Integer&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
     &lt;span class=&quot;n&quot;&gt;invStatementList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Invoice_Statement__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;company&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;acme&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ltd&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;insert&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;invStatementList&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now, when you insert a new Invoice Statement record outside of the test method via a trigger, or batch, or the User Interface, the
next inserted record will have the id &lt;code&gt;INV-2069&lt;/code&gt;. So don&amp;rsquo;t rely on the unique name field if you have strict rules
around the auto-increment feature in your application. Instead add a custom field which is auto-incremented in
a workflow or trigger to have more granular control over how the value is incremented.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Divide (/) operator gotcha&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What do you think should be the output of this statment?&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;divided&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;by&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;is:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you think it should be &lt;code&gt;7 divided by 2 is: 3.5&lt;/code&gt;, then you are wrong. The actual output is - &lt;code&gt;7 divided by 2 is: 3&lt;/code&gt;. If the
operands of the divide(/) operator are both integers, the result is an integer.&lt;/p&gt;

&lt;p&gt;If you want a decimal output then one of the operands must be a decimal, so the following code:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;divided&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;by&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;is:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mf&quot;&gt;7.0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;will output 3.5. I have spent many hours trying to figure out what&amp;rsquo;s wrong with my code when I realized that x/y (x and
y being integers) wasn&amp;rsquo;t returning an accurate decimal value. So make sure when you use the divide operator atleast one
of the operands is a decimal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improve SOQL and SOSL performance by adding NULLability check&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is actually highlighted in the Apex docs, but I have seen many experienced devs(including myself) not following this
simple, but very effective suggestion to improve SOQL and SOSL query performance.&lt;/p&gt;

&lt;p&gt;You can improve the performance of your code by filtering out null values in your SOQL and SOSL queries.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;invNumList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;001&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;002&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;003&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;};&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Invoice_Statement__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;invStatList&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;invNumber&lt;/span&gt; 
                                            &lt;span class=&quot;n&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Invoice_Statement__c&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;where&lt;/span&gt; 
                                            &lt;span class=&quot;n&quot;&gt;invNumber&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;invNumList&lt;/span&gt; 
                                            &lt;span class=&quot;n&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;invNumber&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;That extra check for nullability improves the performance because it avoids searching records that contain null values.&lt;/p&gt;

&lt;p&gt;I hope these tips are useful to some of you! I plan to write more of these in the future. Let me know if you&amp;rsquo;ve come across
other interesting Apex code gotchas in the comments.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2012/04/23/export-to-excel-functionality</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2012/04/23/export-to-excel-functionality"/>
    <title>Export to Excel functionality using the Wizard technique</title>
    <published>2012-04-23T00:00:00+00:00</published>
    <updated>2012-04-23T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;Recently, we were working on a requirement wherein the client wanted an &amp;ldquo;Export to Excel&amp;rdquo; button on a Visualforce page which displays the data in a tabular format. Clicking this button enables them to store the tabular data locally as an excel file. Admittedly, there are several ways to implement this functionality. We will walkthrough an implementation technique that I like to call the &amp;ldquo;Wizard technique&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s create a sample Visualforce page(AccountDataTable.page) with a list of Account records displayed in a &lt;code&gt;&amp;lt;apex:pageBlockTable&amp;gt;&lt;/code&gt; component.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;# AccountDataTable.page
&lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:page&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;controller=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;AccountDataController&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;tabStyle=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Account&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:pageBlock&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;title=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Account Data Table&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:pageBlockTable&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!accounts}&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;var=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;account&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.id}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.name}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.description}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.SLA__c}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.Active__c}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:pageBlockTable&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:pageBlock&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:page&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The controller code is as follows:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sharing&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;AccountDataController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;//constructor&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;AccountDataController&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;//list of accounts&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;List&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Account&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;accounts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;accounts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;accounts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;accounts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Active__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SLA__c&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Description&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Account&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;limit&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;accounts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;Account&lt;/code&gt; data table looks like this in my sandbox.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/screenshot-without-export-to-excel-button.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now, let&amp;rsquo;s create &lt;em&gt;another&lt;/em&gt; Visualforce page(AccountDataExcel) with the contentType attribute set to &lt;code&gt;application/vnd.ms-excel#AccountTable.xls&lt;/code&gt;. This Visualforce page is linked to the &lt;code&gt;AccountDataController.cls&lt;/code&gt; controller that we have used in the &lt;code&gt;AccountDataTable.page&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;# AccountDataExcel.page
&lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:page&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;controller=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;AccountDataController&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;contentType=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;application/vnd.ms-excel#AccountTable.xls&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;showHeader=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;standardStylesheets=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:pageBlock&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:dataTable&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!accounts}&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;var=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;account&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.id}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.name}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.description}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.SLA__c}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;apex:column&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;value=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;{!account.Active__c}&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:dataTable&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:pageBlock&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/apex:page&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;There are 2 things to note in this Visualforce page. First, I&amp;rsquo;m using &lt;code&gt;&amp;lt;apex:dataTable&amp;gt;&lt;/code&gt; instead of &lt;code&gt;&amp;lt;apex:pageBlockTable&amp;gt;&lt;/code&gt;. The reason being that the generated excel file includes some javascript code at the top along with the data. Replacing &lt;code&gt;&amp;lt;apex:pageBlockTable&amp;gt;&lt;/code&gt; with the &lt;code&gt;&amp;lt;apex:dataTable&amp;gt;&lt;/code&gt; resolved this issue(not sure why), and removed the javascript code from the excel file. Second thing to note is the showHeader and standardStyleSheets attribute in the &lt;code&gt;&amp;lt;apex:page&amp;gt;&lt;/code&gt; component is set to false. The contentType attribute is responsible for transforming this page into an excel file.&lt;/p&gt;

&lt;p&gt;We are now ready to add the &amp;ldquo;Export to Excel&amp;rdquo; button to the AccountData.page as follows:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AccountDataController&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;cls&lt;/span&gt; 
&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;excel&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;returns&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;page&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;reference&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AccountDataExcel&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;page&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PageReference&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;exportToExcel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Page&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;AccountDataExcel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And here&amp;rsquo;s the &lt;code&gt;Account&lt;/code&gt; data table with the export to excel button.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/screenshot-with-export-to-excel-button.png&quot; class=&quot;noclip&quot; alt=&quot;Account Table&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And voila! When you click the button, your browser will download the data in an excel file. I call this method the Wizard technique because it mirrors the pattern(more than one Visualforce page linked to the same controller) used to create a wizard based form on the Force.com platform.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://anupjadhav.com/2012/04/22/relaunching-my-blog-on-jekyll</id>
    <link type="text/html" rel="alternate" href="http://anupjadhav.com/2012/04/22/relaunching-my-blog-on-jekyll"/>
    <title>Relaunching my Blog on Jekyll</title>
    <published>2012-04-22T00:00:00+00:00</published>
    <updated>2012-04-22T00:00:00+00:00</updated>
    <author>
      <name>Anup Jadhav</name>
      <uri>http://anupjadhav.com/</uri>
    </author>
    <content type="html">&lt;p&gt;A new blog post is long due on my revamped blog, and I thought I&amp;rsquo;d start by writing a meta-blog-post about how to build a blog using &lt;a href=&quot;https://github.com/mojombo/jekyll&quot; title=&quot;Jekyll on Github&quot;&gt;Jekyll&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Jekyll?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I found out about Jekyll when I came across a blog post about Git on &lt;a href=&quot;http://tom.preston-werner.com&quot;&gt;Tom Preston-Werner&amp;rsquo;s blog&lt;/a&gt;. When I checked out his code on Github, it led me to Jekyll,
and incidentally Tom is the creator of Jekyll. According to the Github page:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Jekyll is a simple, blog aware, static site generator. It takes a template directory 
(representing the raw form of a website), runs it through Textile or Markdown and 
Liquid converters, and spits out a complete, static website suitable for serving 
with Apache or your favorite web server. This is also the engine behind GitHub Pages, 
which you can use to host your project’s page or blog right here from GitHub.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I liked Jekyll right off the bat because it meant I can write blog posts in my favourite text editor(Vim), and will be able to test it locally on
my machine before pushing the change out to the server. The second reason for choosing Jekyll was the ease of integration with Git and Github. It meant I can
use the DVCS I have come to love so much, and also be able to host my pages on Github. I was sold.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used the following tools to build this blog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MacVim editor - edit text at the speed of thought&lt;/li&gt;
&lt;li&gt;homebrew - the missing package manager for OS X&lt;/li&gt;
&lt;li&gt;rbenv - lightweight but powerful ruby version management&lt;/li&gt;
&lt;li&gt;Git - one of the best DVCS&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;You might choose to use a different text editor or VCS, but this tutorial will focus on how to build a Jekyll site on Mac OSX which runs on &lt;a href=&quot;https://github.com&quot; title=&quot;Awesome DVCS&quot;&gt;Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First step is to install the tools listed above if you don&amp;rsquo;t have them on your machine already.
Open a terminal, and install homebrew using the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; /usr/bin/ruby -e &quot;$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)&quot; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you come across any issues, check out the &lt;a href=&quot;https://github.com/mxcl/homebrew/wiki/installation&quot;&gt;brew installation page&lt;/a&gt; to see if you have the pre-requisites installed on your machine.
Then proceed to install rbenv using brew.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; brew update
&amp;gt; brew install rbenv
&amp;gt; brew install ruby-build
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Again, refer to the &lt;a href=&quot;https://github.com/sstephenson/rbenv&quot;&gt;rbenv github page&lt;/a&gt;, if you come across any issues during installation. rbenv will allow you to manage and install different versions
of ruby on your machine. Check out the Github project page for more details, and install the latest version of Ruby. You will also need to install [Rubygems][rubygems].&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s install &lt;a href=&quot;http://git-scm.com&quot;&gt;git&lt;/a&gt; using homebrew.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; brew install git
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then create an account on Github.com, and follow &lt;a href=&quot;http://help.github.com/mac-set-up-git/&quot;&gt;these steps&lt;/a&gt; to link your git installation with your gitub account.
The final step is to install the Jekyll gem.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; sudo gem update --system
&amp;gt; sudo gem install jekyll
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Jekyll comes bundled with Maruku markdown interpreter, but if you prefer to use RDiscount instead of Maruku, then install it as follows:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; sudo gem install rdiscount
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now that you have all of the pre-requisites installed, you are ready to roll out a Jekyll site.
I&amp;rsquo;d recommend forking one of the &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/sites&quot; title=&quot;Existing Jekyll Sites&quot;&gt;existing jekyl sites&lt;/a&gt; on Github and tweaking it to give it your personality.
It will also help you understand how the &lt;em&gt;framework&lt;/em&gt; works. The Jekyll Github page has all of the information that you need to start building your blog.&lt;/p&gt;

&lt;p&gt;Once, you have the directory structure and posts setup, run the following command in the blog root directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;gt; jekyll --server 4000
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will start the server, and &lt;em&gt;compile&lt;/em&gt; your posts and pages into corresponding html pages in the &lt;code&gt;_site&lt;/code&gt; folder. You can preview your website in a browser
by typing &lt;code&gt;http://localhost:4000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The next step is to deploy your jekyll site to Github. To do this, you&amp;rsquo;d have to create a new repo on Github called (github-username).github.com. Then link this repo to
your jekyll blog stored locally. You can find more information on how to do this &lt;a href=&quot;http://help.github.com/pages/&quot; title=&quot;Github Pages&quot;&gt;here&lt;/a&gt;. This page will also tell you how to direct a domain name of your choice to your Github page.&lt;/p&gt;

&lt;p&gt;That&amp;rsquo;s it! You are good to go. If you need more information, or would like me to elaborate a particular step listed above, just drop a line in the comments.&lt;/p&gt;
</content>
  </entry>
  
 
</feed>
