Generate Unique Ids

Generate Unique Id in Apex

Starting from the Spring ’24 release, you can generate UUIDs (Universal Unique Identifiers) in Apex.

Starting from the Spring ’24 release, you can generate UUIDs (Universal Unique Identifiers) in Apex.

Use the new UUID class for that

apex
UUID uniqueId = UUID.randomUUID();

System.debug(uniqueId);

yourCrazyMethodAssigningIds(uniqueId.toString());

Text and code were extracted from the original slide. Plain-text version of the whole catalog