I haven't ever played around with this area (see title).
Situation: I have many Ci types (Desktop, Laptop, Mobile, Tablet, etc), and we create a manual record when a new piece of equipment is delivered. I only ask the Service Desk to fill in the Serial Number, and purchase info. As soon as the device is on the network our Asset Management solution, discovers it.
As a consequence I have a routine (external data map) from Cherwell to Asset Management solution, with the serial number as the unique id.
As a result a scheduled routine will update any record with a matching serial number, rather than create a new record, with all the additional field information (OS, IP, bios, CPU, Mem, etc).
However this doesn't stop a member of staff accidentally creating a new manual record with the same serial number.
Solution Request: I want to prevent staff creating a duplicate record from the same CI type with the same serial number if it already exists.
I have been looking at the the BO properties, database, primary key. This naturally has RedID, but offer the opportunity to add additions. However when I had serialnumber, and publish I notice it drops this. I'm guessing this is because you can only have one primary key? It would make sense, but why offer to add additions? If this is the case, I'm I safe to remove RecID and substitute it for serialnumber? Also would this resolve my request?
Go under the Database page and add an Index that's marked as unique with the two columns.
This adds a hard-limit / SQL limitation to preventing the duplicate record from being created
One thing to note is that if you create a unique index and the table already contains what will now be defined as a duplicate, you will need to address the duplicates before it will let you publish. Not a big deal, just something to be aware of.
Noted Dave. I'll give Doug's suggestion a try on the desktop CI type now, and report back
Sorry guys, but even adding serialnumber as a primary key with unique checked, and publishing, I go back and check and the RecID is the only value as the primary key!!!
Jon, you can only have one primary key. What you want is a unique index, which, if you want, can also contain the primary key. Here is a Config - Server with a unique index on the Asset Tag:
This index will now not allow duplicate asset tags. I could also add more columns to create a unique index, like RecID or Server Name:
I get it now, thanks Dave. Obviously feeling dumb and almost 9pm in UK. I'll give it a try and report back.
I'm obviously being a Muppet, but this is what I get when creating a new index.
That's related to what Dave was saying about having data that's already a duplicate; if you've got existing data that exists more than once and wouldn't be legal in the index, you'll need to clear out the duplicates before adding a unique index.
Thanks guys all sorted. I was looking for duplicates just within the Desktop CI type of which there was none, so couldn't understand why this wasn't working. I didn't realise to check across all config items. Index now added.