Can we change the Sys_id of a record. If so, what happend if we give two records same sys_id.

vinay167
Tera Contributor

Recently i was playing around sys_id and this questions comes in my mind when i am creating a new record from business rule that can we also set sys_id. When i go on ChatGpt it gives me a function .setUniqueValue();

1 REPLY 1

Brad Bowman
Kilo Patron
Kilo Patron

setUniqueValue will set the sys_id to a unique one, but is not needed when creating a record with GlideRecord and initialize() or newRecord() as this will automatically happen.  You CANNOT set a sys_id to any other value when creating or updating a record as this is THE unique identifier for all records.