Business rule present on cmdb_ci table is affecting alm_hardware
						
					
					
				
			
		
	
			
	
	
	
	
	
Options
			
				
					
	
			
		
	- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 09:44 PM
Hi All,
We have a custom business rule (On Before - Insert and Update) on cmdb_ci table to check the CI name duplication.
(function executeRule(current, previous /*null when async*/) {
    var name = current.getValue("name");
    var cmdbCI = new GlideRecord("cmdb_ci");
    cmdbCI.addQuery("name", name);
    cmdbCI.addQuery("sys_id", "!=", current.getUniqueValue());
    cmdbCI.query();
    if (cmdbCI.next())
    {
        gs.addErrorMessage('Record already exists with name: ' + name);
        current.setAbortAction(true);
        current.setWorkflow(false);      
    }
})(current, previous);
The issue is when we made some updates on alm_hardware table, we are receiving the error message 'Record already exists with name: null'. The error message is coming from the above BR. I have deactivated this BR and updated the alm_hardware record. Error message is not appearing. 
I am new to CMDB , can someone help me to understand the relationship between these two tables and help me to fix the issue.
Thanks
		1 REPLY 1
	
		
		
			
			
			
					
	
			Options
			
				
					
	
			
		
	- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2024 10:09 PM
Please read the following documentation page and try to understand the concept of asset and CI synchronization: https://docs.servicenow.com/bundle/washingtondc-it-asset-management/page/product/hardware-asset-mana...
