Skip to main content
2 of 2
added 24 characters in body
sfdcfox
  • 501.7k
  • 21
  • 473
  • 828
  1. Consider mapping all your WorkOrders/Wrappers by a combination key (i.e UniqueKey__c + '.'+ Work_Order_Sequence__c.leftPad(10, '0') ).

  2. sort your combo key list comboKey = new List(mapWO.keyset()); combokey.sort();

  3. iterate through sorted combokey and create a new list of WorkOrders/Wrappers.

     LIST<WO> wo = new LIST<WO>();
     for (string k : comboKey )
     wo.add(mapWO.get(k));
    

should not need the to implement comparable since you are converting to padded number and can just leverage the standard alpha sort.