Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [comparable]

The tag has no usage guidance.

0
votes
2answers
333 views

Is there a way in process builder to check if a date is set and if so, if it is greater than something?

I am trying to implement some form of attribution, where there are two cases: Date has not been set (i.e. this is the first opportunity) Date has been set (i.e. this is not the first opportunity) ...
10
votes
1answer
591 views

System.ListException: One or more of the items in this list is not Comparable

I have an interface, MyInterface, that extends Comparable since I want to be able to sort lists of these objects: 1 global interface MyInterface 2 extends Comparable { All classes that ...
1
vote
2answers
168 views

ERROR: Dynamic sorting in Wrapper class' column header

I have implemented a Wrapper class using this: Salesforce Wrapper Class. Now I am trying to implement sorting for the column header which turns out to be throwing error: Invalid field Account.Name ...
0
votes
1answer
58 views

Invalid Type for Comparable Implementation

I am sure this is a simple fix but I can not figure out why my test class can not see my comparable class. The error I am getting is invalid type: CaseInfo. Why would this be happening? I am following ...
0
votes
1answer
39 views

Sorting of the 2 child records referencing each of their date fields (START DATE)

I have three objects, the Professional_Experience__c, Assignment__c, and Project__c. Professional Experience has two child (Assignment__c, and Project__c). Then the Assignment__c has also a child (...
0
votes
1answer
55 views

How can we sort based on the number of matched filtered

Can someone help us with regards to sort based on the number of matched filtered. We need to prioritized the number of matched filtered on SKILLS rather than (skills + training / skills + ...
1
vote
1answer
169 views

Sorting of fields of custom object using comparable in a wrapper

I have a wrapper class which is sorted by the totalCount of the size of the three list (empSkillList, empTrainingList, and empCertificationList). Can I sort it also by the fields inside the list of ...
0
votes
2answers
70 views

Comparable Interface not sorting

I am trying to implement the comparable interface but I cannot get it to work, nothing seems to make any difference with the ordering of the lists. public Class MyWrapper implements Comparable { ...
2
votes
4answers
684 views

SOQL Error in Compare Date

Could you please help me for fix my SOQL Query? I have SOQL Scrip like : SELECT Employee_No__c FROM HREMPASSIGNMENT__c WHERE Payroll_Name__c=:selectedPayrollName AND Payroll_Name__c != null ...
0
votes
1answer
45 views

how to find the period between two periods date?

I have one date "TRIG_DATE" date variable. I want to check where it falls under period1 or period2 In period 1 i have two fields "UperDate1__c" and "LowerDate1__c" In period 2 i have two ...
1
vote
1answer
243 views

Problems implementing comparable class

I am trying to sort list x in descending order by Delta__c. I have been told that I should use a wrapper class and use the implements comparable class. I am getting the error even though Delta__c is ...
3
votes
1answer
285 views

Implementing CompareTo In An Inner Class That Needs Outer Class Data

I'm using Apex and VisualForce to make an "open house event check-in page" for a department. For various reasons pertaining to AppExchange plugin compatibility, we are storing a separate "Event" ...
4
votes
1answer
964 views

Sort List of SObject in Wrapper Class

I have Wrapper class which contains List of Map. After performing some operations that List values order gets changed. public class TeacherAvailabilityWrapper{ public List<Session__c> ...
4
votes
1answer
234 views

Notes & Attachments Wrapper class not sorting by LastModifiedDate correctly

I am using the below code with the Comparable interface to build a combined list of all the attachments and notes on a record, sorted in descending order of LastModifiedDate (in constructor of main ...
1
vote
1answer
553 views

How to sort a custom list of Notes and Attachments by LastModifiedDate

In my VF Page I have been asked to show a list of all the Notes and Attachments in one table, and sorted by the common LastModifiedDate ... So I have a wrapper class in my custom controller: public ...
0
votes
2answers
1k views

Comparing fields in two different objects in a SOQL query

I am trying to create an Apex Controller that outputs a list of event records. I would only like to print the oldest from each account where the Event is a meeting. After much thought I think the best ...
5
votes
1answer
1k views

Apex equivalent of Java Comparator

I already know about the equivalent of Comparable - the class to be sorted should implement Comparable and then you can sort a List of said class. But, how about Comparator? In java, the Collections....
2
votes
1answer
51 views

Wrapper List Sort by 2 text values

I have a wrapper class with 2 text values. I sorted them using Comparable. It works fine for one value. Here, I have AreaName and ADName. With the below I'm able to successfully sort by AreaName. ...