<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How to Sort Wrapper class Collection in Apex	</title>
	<atom:link href="https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/</link>
	<description>AI, Salesforce, ServiceNow &#38; Enterprise Tech Guides</description>
	<lastBuildDate>Tue, 01 Jan 2019 22:42:20 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: test87		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-4963</link>

		<dc:creator><![CDATA[test87]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 22:42:20 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-4963</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-4772&quot;&gt;Harshad&lt;/a&gt;.

How the date compare to is going to work here, lets say if i want to compare by publishingDate ?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-4772">Harshad</a>.</p>
<p>How the date compare to is going to work here, lets say if i want to compare by publishingDate ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Harshad		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-4772</link>

		<dc:creator><![CDATA[Harshad]]></dc:creator>
		<pubDate>Fri, 12 Oct 2018 10:32:30 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-4772</guid>

					<description><![CDATA[what if I want to compare by both i.e 1st price and then name]]></description>
			<content:encoded><![CDATA[<p>what if I want to compare by both i.e 1st price and then name</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: mike		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-3424</link>

		<dc:creator><![CDATA[mike]]></dc:creator>
		<pubDate>Tue, 30 Aug 2016 17:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-3424</guid>

					<description><![CDATA[How can this be changed to descending order?]]></description>
			<content:encoded><![CDATA[<p>How can this be changed to descending order?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: krishna		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-2282</link>

		<dc:creator><![CDATA[krishna]]></dc:creator>
		<pubDate>Mon, 29 Sep 2014 06:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-2282</guid>

					<description><![CDATA[can any one will please do this VF page controller, if any question please ask me about this VF page]]></description>
			<content:encoded><![CDATA[<p>can any one will please do this VF page controller, if any question please ask me about this VF page</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JitendraZaa		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1286</link>

		<dc:creator><![CDATA[JitendraZaa]]></dc:creator>
		<pubDate>Mon, 04 Feb 2013 05:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-1286</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1285&quot;&gt;VN&lt;/a&gt;.

Hi ,
Above code is not complete. What is typo and how you are comparing object &quot;objToCompare&quot; ?


Please post complete code.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1285">VN</a>.</p>
<p>Hi ,<br />
Above code is not complete. What is typo and how you are comparing object &#8220;objToCompare&#8221; ?</p>
<p>Please post complete code.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: VN		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1285</link>

		<dc:creator><![CDATA[VN]]></dc:creator>
		<pubDate>Mon, 04 Feb 2013 05:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-1285</guid>

					<description><![CDATA[Hi Jitendra,

Can u please guide me ... I have followed the steps for wrapper sorting and its working great in   a table doen&#039;t have any null values... but in my table having null values for few columns then its giving errors... Please see my piece of code. 

 global with sharing class ActivitiesCollection implements Comparable { 
      public string   type{get;set;}
}  

public enum SORT_BY {
ByType
    }

    public enum Order_By{
        ascend, descend
    }
global integer compareTo(Object objToCompare) {
        if (typo != null &#038;&#038; typo != &#039;&#039; &#038;&#038; type != null &#038;&#038; type != &#039;&#039; &#038;&#038; sortBy ==SORT_BY.ByType &#038;&#038; orderBy == Order_BY.ascend)
            return type.compareTo(typo);
        else if (typo != null &#038;&#038; typo != &#039;&#039; &#038;&#038; type != null &#038;&#038; type != &#039;&#039; &#038;&#038; typo != &#039;--None--&#039; &#038;&#038; sortBy ==SORT_BY.ByType &#038;&#038; orderBy == Order_BY.descend)
}
            return typo.compareTo(type);

}


Please help me.]]></description>
			<content:encoded><![CDATA[<p>Hi Jitendra,</p>
<p>Can u please guide me &#8230; I have followed the steps for wrapper sorting and its working great in   a table doen&#8217;t have any null values&#8230; but in my table having null values for few columns then its giving errors&#8230; Please see my piece of code. </p>
<p> global with sharing class ActivitiesCollection implements Comparable {<br />
      public string   type{get;set;}<br />
}  </p>
<p>public enum SORT_BY {<br />
ByType<br />
    }</p>
<p>    public enum Order_By{<br />
        ascend, descend<br />
    }<br />
global integer compareTo(Object objToCompare) {<br />
        if (typo != null &amp;&amp; typo != &#8221; &amp;&amp; type != null &amp;&amp; type != &#8221; &amp;&amp; sortBy ==SORT_BY.ByType &amp;&amp; orderBy == Order_BY.ascend)<br />
            return type.compareTo(typo);<br />
        else if (typo != null &amp;&amp; typo != &#8221; &amp;&amp; type != null &amp;&amp; type != &#8221; &amp;&amp; typo != &#8216;&#8211;None&#8211;&#8216; &amp;&amp; sortBy ==SORT_BY.ByType &amp;&amp; orderBy == Order_BY.descend)<br />
}<br />
            return typo.compareTo(type);</p>
<p>}</p>
<p>Please help me.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JitendraZaa		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1284</link>

		<dc:creator><![CDATA[JitendraZaa]]></dc:creator>
		<pubDate>Mon, 07 Jan 2013 17:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-1284</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1283&quot;&gt;Aravind&lt;/a&gt;.

Yes,

Its upto you how you return the value in method &quot;compareTo&quot;.

Just change the logic and go..]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1283">Aravind</a>.</p>
<p>Yes,</p>
<p>Its upto you how you return the value in method &#8220;compareTo&#8221;.</p>
<p>Just change the logic and go..</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aravind		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1283</link>

		<dc:creator><![CDATA[Aravind]]></dc:creator>
		<pubDate>Mon, 07 Jan 2013 17:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-1283</guid>

					<description><![CDATA[Is there any way that we can specify sorting order like ascending or descending order?]]></description>
			<content:encoded><![CDATA[<p>Is there any way that we can specify sorting order like ascending or descending order?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aravind		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1282</link>

		<dc:creator><![CDATA[Aravind]]></dc:creator>
		<pubDate>Mon, 07 Jan 2013 17:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-1282</guid>

					<description><![CDATA[Thanks dude. It is good peace of code.]]></description>
			<content:encoded><![CDATA[<p>Thanks dude. It is good peace of code.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Zaidy Ramirez		</title>
		<link>https://www.jitendrazaa.com/blog/salesforce/how-to-sort-wrapper-class-collection-in-apex/#comment-1281</link>

		<dc:creator><![CDATA[Zaidy Ramirez]]></dc:creator>
		<pubDate>Tue, 06 Nov 2012 18:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=3033#comment-1281</guid>

					<description><![CDATA[Thank you for this, it is very useful. Any chance to pick your brain on how to sort by two wrapper properties? so first BookTitle, then BookPrice... any comments would be appreciated.]]></description>
			<content:encoded><![CDATA[<p>Thank you for this, it is very useful. Any chance to pick your brain on how to sort by two wrapper properties? so first BookTitle, then BookPrice&#8230; any comments would be appreciated.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.jitendrazaa.com @ 2026-06-01 15:11:47 by W3 Total Cache
-->