This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserRoleInserter{ | |
final private Map<String,String> roleNamePerParentRoleName; | |
public UserRoleInserter(){ | |
this.roleNamePerParentRoleName = new Map<String,String>(); | |
} | |
public void PutUserRoleHierarchy(final String aUserRole, final String aParentUserRole) { | |
this.roleNamePerParentRoleName.put(aUserRole,aParentUserRole); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class RecordTypeHandler { | |
// Build a local cache so that we don't request this multiple times | |
private static Map<Schema.SObjectType,Map<String,Id>> rtypesCache; | |
static { | |
rtypesCache = new Map<Schema.SObjectType,Map<String,Id>>(); | |
} | |
// Returns a map of active, user-available RecordType IDs for a given SObjectType, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string generate18CharId(final string id){ | |
final String abecedair = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ012345'; | |
if (String.isBlank(id) || (id.length() != 15 && id.length() != 18)) { | |
return null; | |
} | |
if (id.length() == 18) { | |
return id; | |
} | |
string suffix = ''; | |
for (integer i = 0; i < 3; i++) { |