How to make Serial Number Field "Unique" only in Computer (cmdb_ci_computer) table?

kutvaram
Tera Expert

Hi All,

In computer (cmdb_ci_computer) table, I want to make "Serial Number" field to be unique. How to achieve it?

If I right click the "Serial Number" field and go to dictionary, it is showing me the parent / base table (cmdb).

As there are duplicates in other than computer table, I cannot make it to "Unique".

Please let me know your suggestions.

Thanks & Regards,

Ram Prakash

4 REPLIES 4

vinitha3
Tera Guru

How does the record import happen to this table?


If it a scheduled import - Please select this field in transform map and coalesce it so that when ever records are imported into that table if it has new serial number it inserts and updates it if it is an existing one.



http://wiki.servicenow.com/index.php?title=Using_the_Coalesce_Field#gsc.tab=0



Thank you,


Vinitha.K


Please hit helpful or correct answer if it had helped you.


Kostya
Tera Guru

For child classes you can use "Dictionary overrides" on the bottom of this page. But you cannot override the "uniqness". You only can set for cmdb_ci class (https://<yourinstance>.service-now.com/sys_dictionary_list.do?sysparm_query=name%3Dcmdb%5Eelement%3Dserial_number)



You can achive this with OnBefore Insert Business rule and query the cmdb_ci_computer table before inserting. But you can have performance impact this way.


Hit the Thumb Icon and/or mark as Correct, if my answer was correct. So you help others to see correct responses and I get fame 🙂

Cheers,
Kostya

Bruno De Graeve
ServiceNow Employee
ServiceNow Employee

Why setting CMDB/Asset Serial Number field as Unique to prevent duplicates is not a good idea

suggested is to read this Support KBA

Bruno De Graeve,
Principal Platform Architect, Customer Success, ServiceNow

Patel4
Tera Contributor

Hello,
I have a similar request, where I need to auto-populate the sys ID of the record to missing serial number CIs.

I'm trying to write the business rule for this. May I get help, please?