Reference cascade rule in Eureka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2015 03:49 AM
HI all,
Is there any way to prevent empty reference field when referenced record is deleted.
e.g.
I'm creating incident with Caller "foo.bar" and after that i'm deleting him from "sys_user" table.
Caller field is now empty, is it possible that his first name and last name will be still visible?
I was trying to make Reference cascade rule: Restrict, too, but i was able to delete user anyway.
Any ideas how to make in Eureka Relase??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2015 07:45 AM
I tried the same thing on my instance. I changed Caller to "Restrict", added one of the built in users to an Incident and then tried to delete the user. I first got the confirmation about the related records that would be deleted, like User Entitlements. I said OK to that, than got this message:
Is it possible you are missing something else, like not actually saving the dictionary entry or something like that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2015 07:47 AM
Also, you are not going to be able to delete the referenced caller but keep the name around. That's a Reference field so the only thing it can do is hold a sys_id to another record. To do that, you'd have to create another field of String type and place the text of the name in it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2016 03:59 PM
Have you tried selecting "None" (not the empty "-- None --") in the list? Based on the wiki, that seems to be what you need. I haven't tried it myself yet though.
- Clear or -- None --: deleting a record clears references (default option).
- Delete or Cascade: deleting a record also deletes all referencing records. For example, when a user record is deleted, any incidents assigned to the user are also deleted. Use this method with caution.
- Restrict: deleting a record is restricted unless there are no references to the record. For example, prevent the user record from being deleted if any incident includes a reference to the user.
- None: deleting a record does not change records that reference the record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2016 05:52 AM
Grzegorz,
Expanding on Andy's point, you'll have set the Reference Cascade Rule field on the sys_dictionary record for the field which you don't to be deleted when the corresponding user record is deleted.
For example: The Caller field on the incident table or Requested For field in the request table.
An important point to note is that the field will show as empty, however, the XML record will show the sys_id of the user which was deleted. Also, if you have a mandatory UI policy on that field, it will by pass it since there is a sys_id recorded, however, you just won't see any value in the field.
But this is a very slippery slope as the user field is referenced in 200+ places. You can see exactly which fields are using this by doing the following. Once you've got your list, you'll have to set each one of the fields Reference Cascade Rule field to "None".
To make it easy for you, I'm providing the URL and system path below. Just make sure to substitute xxx your SN instance.
URL
System Path:
1. Go to sys_dictionary.list
2. Filter Type field for "Reference" and Reference field for "User"
Hope this helps.
- RV