Doctype fields are not showing in customization

I’ve stumbled into this problem randomly while customizing doctype

All of the doctype fields are not showing and this is the error


Any idea what might’ve triggered this error or is this a bug?
I have tried several bench commands like clear-cache, build and migrate but this did not fix it.
I hope someone can help me fix this thank you.

few thoughts from the top of the head:

  1. do bench migrate
    if it did not solve the issue:
  2. do bench build
    if that did not solve it also:
  3. do bench update --rebase ********* this will update and rebuild everything and lose all customization.

@ramielian thanks for your response, I’ve tried your solution already but it seems that it doesn’t solve the problem, I think the problem is in the database, what I did was, I back up my database and reinstall frappe, erpnext, and my custom app completely, the problem was gone but after importing my data, the problem goes back again, so I think there is a bug that somewhat broke the database while customizing doctype and I don’t know what might’ve caused it.

I just discoverd now that the cause of this problem is when adding Table MultiSelect and using DocType as option. I’m using v12 erpnext, I don’t know if this is already fixed in later version.

I Don’t see any issue in that, I am guessing you have a custom field that is made wrong, but there is nothing wrong in using a doctype in the table field, actually, it is required.

@ramielian What I mean is this, I have added a field Table MultiSelect and use DocType as an Option,
as you can see no error here.

But after saving then refresh the error pops out and the fields are gone.

I removed all the other fields just to make sure it does not cause any conflicts but got the same result.
If I use other options like Item or Customer, etc, it does not produce such error.
Do you have any tips to prevent this in the future?