I am running batch in the background where I am creating Master Accounts based on some criteria, however for testing purpose I deleted all Master Account records which were created from running the batch class.

Now when I am running the batch again, which will create the Master Accounts and will link to child accounts based on logic added, I observed that for few of the records on which Master Accounts were linked are referencing the old Master Account which I have Deleted.

I cleared all the data from my Recycle Bin
enter image description here

But still when I go to child account record, I found that reference is still there for the record which I have deleted.
I am getting following message when I hover over record on detail page:
enter image description here

Why the value is not getting Clear from the Look-up field even though I have enabled option :
What to do if the lookup record is deleted? Clear the value of this field.
Please suggest and advise.

  • Hi. What's the type of your field "Master Customer Account"? When you create a look up relationship, you can choose to clear the field when the master record is deleted. Jan 12 '17 at 9:17
  • Yes the option is enabled for this field :- What to do if the lookup record is deleted? Clear the value of this field. Jan 12 '17 at 9:21

Assuming you are trying to remove this ghost data... Try running the same query with WHERE clause isDeleted = true, then maybe run a hard delete on the returned records.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.