Reference Field value getting removed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 08:59 AM
I m working on a custom Application and currently in Fuji Release..
I have a main form(appln) which has reference to multiple tables ,,, one of the reference field is macro team.. and we had data in the main table(macro)
As part of data maintenance, we happened to reload all the data in macro team. As a result of this, the main table which had reference to Macro team is wiped off.. Dont know why it happens
Also , i m running a filter in my table with the reference field.. If the sysid returned by my script include is not present, then it takes the condition as empty... and displays entire records...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 09:02 AM
Hi Kailash,
Not sure what you mean by reloading data but if that means deleting the records to them import them back with the same sys_id, then to keep the reference you would have to change the cascade delete rule of your reference field (Reference Fields - ServiceNow Wiki )
You should use "None" to keep the references even when the records are deleted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 09:06 AM
yes lchicoine
you are right.... Now i have already deleted the data and reloaded it.. What options i have currently?
And also lets say my script include for a field returns a value "xxxxxxx". if i use the condition as macro_team is "XXXXxxxxx".. Automatically it changes to macro_team is empty and then displaying different results...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 09:12 AM
Lets say i keep the cascade delete rule to "None". i deleted the user record "Kailash".. So the record which references with my name will have empty field or it would be cleared...
And again after some days, i add my user record in the table.. This time, my name will have different sysid. i want all the records which referenced my name has the value "kailash" in the user record now without seeing an empty field...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2017 09:28 AM
Hi Kailash,
If you set the rule to "None" then the record with the reference field will keep the sys_id stored (this is not considered empty by the system, simply a broken reference (in the UI it will look as empty but not with a filter), which if you go into the record you won't see any display value and the hover of the reference will get you a record not found or something like that).
As for your requirement, of having the new record (user) to replace old references that would be quite complex. You would probably be better with something like active/inactive to avoid deleting referenced records.