Oh No, The CI Object Picker Only Shows Key Values!

I get this question a lot…

“I’ve created a new class and created a relationship from another class to it.  I’ve configured a form that has a Single Instance Picker that targets my new class.  When I open the form in the SCSM console, instead of seeing the friendly name of my class records, I instead see the values of the key property.”

It’s a common adventure to create a Name property in your new class.  For example, you create a CI class called “VDIPools”, with  a key property of “VDIPoolID”.  The key property auto-increments and has a default value of “VDIP{0}”.  You need a clear way of identifying the pools so you create a string property called “VDIName”.  You then create  a new form for use when creating or editing your VDI Pool records, and include all your customer properties.

You  seal up your management packs, import them into SCSM, and create a CI for a VDI Pool.

posts-vdipoolscrnsht01

You then open a new CR and want to add your VDI Pool as a related CI.  When the object picker form opens, instead of seeing your VDI Pool Names, you see the values of your “VDI Pool ID” key class property  (See screenshot).  Which to be frank is neither use to man nor beast.

posts-vdipoolscrnsht02

The object picker form that is dynamically generated by the SCSM console automatically uses the class property “DisplayName”.  If you choose not to populate this property in your class CIs then the key property is shown instead, either in object pickers, or class views, or wherever it is displayed.

There are two solutions to resolve the issue.  One simple and one less so.

Simple Solution

Instead of using “VDI Pool Name”, use the built in CI property that is automatically inherited when you create any CI class of “DisplayName”.

It really is that simple.  This means that you maintain your ‘ID’ key property (which must be unique for each record), and can edit the “DisplayName” property as many times as you like.

Not So Simple Solution

The key can be set on any string value you like, so you could set your “VDIPoolName” property as your key instead of having “VDIPoolID”.  Your form can then use this property instead of the “DisplayName” property.  As the object picker automatically displays the contents of the key when the “DisplayName” property is empty you will see your friendly names.

The downside is that you will never, ever be able to edit your VDI Name, so if you make a spelling mistake or the name of the actual VDI Pool changes later on, you would have to delete the record and recreate it in order to change the VDI Name of your class records.  This is because the contents of a string property that is marked as a key are fixed in stone once the records is first committed.  Deleting a record and recreating it doesn’t sound that hard, but think of all the relationships you have between your record and other items such as Incidents, Service Requests, Users, Computers, etc, etc.  Once you delete the record you also delete all those relationships, and you’ll be hard pressed to recreate them for closed IRs, particularly if they’ve been purged from the Operational DB post import into the DW.

 

 

A Note on Cardinality

in SCSM, cardinality is set on relationships between properties in classes.  It is also the key configuration piece that allows your Single Instance Picker, List Views, etc, to bind to the relationship.

It is important to ensure you set the right cardinality settings so below is a little table that covers basic configuration.

 

Cardinality Configuration Relationship Type Configuration Result
Source:
Max Cardinality: 2147483647
Min Cardinality: 0
Target:
Max Cardinality: 1
Min Cardinality: 0
Many to One. Target can be related to multiple source records.   Source record can be related to one target record Relationship is available as a binding in the form bound to the Source class
Source:
Max Cardinality: 2147483647
Min Cardinality: 0
Target:
Max Cardinality: 2147483647
Min Cardinality: 0
Many to Many. Target can be related to multiple source records and vice versa. Relationship is available as a binding in the form bound to the Source class
Source:
Max Cardinality: 1
Min Cardinality: 0
Target:
Max Cardinality: 1
Min Cardinality: 0
One to One. Target can b related to one source record and vice versa Relationship is available as a binding in the form bound to the Source class
Source:
Max Cardinality: 1
Min Cardinality: 0
Target:
Max Cardinality: 2147483647
Min Cardinality: 0
One to Many. Target can be related to one source records. Source record can be related to many target records Relationship is NOT available as a binding in the form bound to the source class