Maintenance is complete- We've moved from the saas.hpe.com domain to softwaregrp.com click to read more
As part of our journey to complete our separation work and our future integration with Micro Focus, we've now updated our domain for the community. This is an interim step, which will be followed by a series of future update / improvements: - Piloting Idea boards - Refreshing the entire UI. (more to come later) - and more
Service Desk Practitioners Forum
cancel

How to search for an item in SErvice desk Databse

vikrant_2
Super Contributor.

How to search for an item in SErvice desk Databse

We are using Sd 4.5 sp 14. We would like to create a script for checking Serial no from the SD database in case when a new CI is saved. I will definde a rule that if Serial No. Is found in database the CI should not be saved.
6 REPLIES
Dan Ioan
Honored Contributor.

Re: How to search for an item in SErvice desk Databse

Hi,
Despite of a very small probability to have same Serial Number for different type of CIs this is not zero! Especially when a serial is a simple number, could be possible to have the same serial for two different CIs. In this case, you can associate another type of IDs for the items owned by your organization: Inventory Number or Barcode which are unique, indeed. Of course, sometimes, duplicates of serial numbers are the result of wrong information coming from suppliers or even from manufacturers! So, run your script before data import for new CIs and use also unique ID established by your asset management department.
Best regards,
Dan
vikrant_2
Super Contributor.

Re: How to search for an item in SErvice desk Databse

HI dan
Problem is this that there may be a chance of data entry for serial no. going wrong as it is required for amc/warranty status
Robert S. Falko
Acclaimed Contributor.

Re: How to search for an item in SErvice desk Databse

Hi,

Create a UI rule that is triggered by an update to the serial number field, where the serial number is not empty. Pass the input serial number as a parameter.


Run a script that contains :

SELECT COUNT(*) FROM ITSM_CONFIGURATION_ITEMS WHERE CIT_SERIALNUMBER = 'your serial number'

If it returns a value greater than 0, then I suggest you display an error message and then have the Web API reset the serial number. That way, you can be sure that you will not save the CI with a duplicate serial number. You will probably want to return the search code of any CI that already has the serial number, so you can display this in the error message.

-Josh
Hanspeter Loche
Super Contributor.

Re: How to search for an item in SErvice desk Databse

Hi All
It's not that uncommon to have identical serial numbers for different hardware. I myself struggle with that behaviour. We have Dell PCs which I import via SMS data base. Older PCs have a "dummy" S/N like 123456 or 000000 but would also like to have a unique key for every PC. Issue might disappear with time :-)
Regrads
Hanspeter
vikrant_2
Super Contributor.

Re: How to search for an item in SErvice desk Databse

If it returns a value greater than 0, then I suggest you display an error message and then have the Web API reset the serial number. That way, you can be sure that you will not save the CI with a duplicate serial number. You will probably want to return the search code of any CI that already has the serial number, so you can display this in the error message.

Hi Jessiah
How to display the error message and we use SD Client and not web api.
Robert S. Falko
Acclaimed Contributor.

Re: How to search for an item in SErvice desk Databse

Vikrant,

You must run an external program in order to count the number of rows. That program could display the message.

However, you may also displays messages (information, warnings, errors) using a UI rule triggered before saving the object. Normally, you should display your message as soon as the duplicate serial no. is entered, so this might be too late to be useful.

-Josh