function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mchesiremchesire 

Unique ID

I have a custom object and I need to populate a Unique identifier in one of the fields.  Is there any function that can generate an ID?

 

Thanks,

MC

imuinoimuino
Evrey object created on force.com has its own unique Id so you dont need to create it
mchesiremchesire
Yes, that is true.  I am trying to generate an ID for another field within that object (besides the one created on force.com).  I know that flex has a createUID function and was wondering if there is something similar within apex.
SuperfellSuperfell
There isn't. Can you expand on why you just don't want to use the record Id ?
MiddhaMiddha

If its only about creating a unique identifier, you can try creating an "Auto Number" field on the object.

 

/G 

mchesiremchesire
Thanks for the suggestion.  I found a solution.  I appended a timestamp to the field.