Not able to delete record ?

sukran
Mega Sage

We have duplicate test record in model names and we need to delete on that, but not able to doing this

Below error we get it

Delete of   Test record not allowed because of a reference in record 5czczb within the Base Configuration Item file

Delete of Test record not allowed because of a reference in record 4888BY within the Base Configuration Item file

How to delete this without lose any other file

9 REPLIES 9

shloke04
Kilo Patron

Hi,



As mentioned by Stacey, This is because of "Reference Cascade Rule" defined as "Restrict" in the dictionary of the reference field, which does not allow you to delete Records if it has some references to the Record.



To avoid this Navigate to the Dictionary of the field and select Reference Cascade Rule as "None". as shown below in the screen shot for example:



find_real_file.png



You can also the refer the below link for more details in section 7:



Reference Fields - ServiceNow Wiki



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi Shloke,



I think it wont be a good option to change the cascade deletion for just deleting 2 records. It serves a purpose to maintain CI relationships and we should consider the option only if the entire table should be cleaned up.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


Hi,



Thanks for your response. By default OOB Reference Cascade is set to Clear or None only, so thought of reverting to what OOB changes are.Can you please help me understand what are the disadvantages if we update the existing Reference Cascade value??



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

The restrict is set on purpose to maintain references on model name and prevent its deletion on whichever assets they are referred. For eg: You are deleting a Dell model laptop which is referred in 100's of user assets. If this is not restricted, any accidental deletion of model record would remove it from all related user assets and it can create issues in your asset management or service request modules with data.



If you need to cleanup entire table data, then revert it back and perform delete All Or else just remove the references from the 2 asset records and then manually delete the single model. This ensures the process is maintained on asset data management.



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


shloke04
Kilo Patron

Hi,



Please mark the answer as correct if your query is Resolved so that the thread can be closed.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke