Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trigger setGuid on dftly_app_contact__c (before insert) {
- For (dftly_app_contact__c dac: Trigger.new){
- Blob b = Crypto.GenerateAESKey(128);
- String h = EncodingUtil.ConvertTohex(b);
- String guid = h.SubString(0,8)+ '-' +
- h.SubString(8,12) + '-' +
- h.SubString(12,16) + '-' +
- h.SubString(16,20) + '-' +
- h.substring(20);
- system.debug(guid);
- dac.Guid_App_Contact__c = guid;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement