sort
Environment Apex Premise You can sort List of Objects with using sort method as below. gist.github.com In above example, shops is sorted by name ascending order ( Shop A, Shop B, Shop C). But what if you want to sort by multiple fields in …
Environment Apex Code String sobjectApiName = 'Account'; Map<String, Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get(sobjectApiName).getDescribe().fields.getMap(); List<String> fieldNames = new List<String>(fieldMap.keySet()); fieldNames.sort(); for (String fieldName: </string></string></string,>…