function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
I want to generate a 8-character auto password in my standard object, when i will save my record.
Please help me to find out the solution of this.
Thanks in advance!
do you want to generate any random password or some specific one?
i want to generate a random password.
To generate random password use cryto class in apex and use cryto.getrandominteger() gives the random number.
public class PasswordGenerator { public static String getPassword(Integer len) { Blob blobKey = crypto.generateAesKey(128); String key = EncodingUtil.convertToHex(blobKey); System.debug(key); return key.substring(0,len); } public static testMethod void testPG() { System.debug(PasswordGenerator.getPassword(8)); } }
do you want to generate any random password or some specific one?
i want to generate a random password.
To generate random password use cryto class in apex and use cryto.getrandominteger() gives the random number.