You need to sign in to do that
Don't have an account?
Joanna Knott 6
Alpha-numeric auto generated ID
Is there a way to create an alpha-numeric auto generated ID consisting of random letters and numbers?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
You can refer to this post: http://salesforce.stackexchange.com/questions/43823/how-do-i-generate-a-random-string
public static String generateRandomString(Integer len) {
final String chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
String randStr = '';
while (randStr.length() < len) {
Integer idx = Math.mod(Math.abs(Crypto.getRandomInteger()), 62);
randStr += chars.substring(idx, idx+1);
}
return randStr;
}
Thanks,
Pratik