
I've got some code in a trigger for updating a service contract (checkboxes) based on the types of contractlineitems it has associated with it and whether they are Active, Inactive or Expired.
When I sort the SOQL query by the contractlineitem status field I get the following results (sorted by Status)
Service Contract 1
Inactive
Inactive
Active
Service Contract 2
Active
Active
Expired
I'm not understanding how, using the same query and ordering, Active can come before Expired, but after Inactive?
Any help appreciated as this is driving me nuts!
Dave
6 risposte
You could sort the list after you get it in your code from the SOQL if you need to process them in a certain order.