Business rule present on cmdb_ci table is affecting alm_hardware

mohanambalnanja
Tera Contributor

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

Maik Skoddow
Tera Patron
Tera Patron

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...