Custom Field Fixtures Error


I am using frappe version 5
I have created custom fields on my local setup, then I took fixtures of custom fields in custom app. While pulling these changes on production server using “bench update” I encountered an error frappe.exceptions.DoesNotExistError: Insert After field ‘date_details’ mentioned in Custom Field ‘Start Date’, does not exist. Due to this error, out of 9 custom field only 2 are visible on Application.

I have pasted custom_field.json value in PasteBin

Kindly suggest your opinion

Hi, @rohit_w, the management of ‘Custom Fields’ based on fixtures have something issues, especially when used in conjunction with them Customize Form, because you can create new fields using the customize form, but the customize form dont perfom the custom field completely.

My recommendations for you is:

Make your custom fields, and organize the layout using the Custom Field, filling the field “Insert After” and ensure that all fields have this field filled.

Another thing, dont import your fixtures using the standard behavior of the system, because you can get some errors that dont will finish the completely importation of your fixtures.

In your app make a function hooked to the event “after_install”, that will import your fixtures, sometimes you can get the error “Not Found” because one field is defined before the field of the layout. ensure that your function will manage this error, and reimport the fixtures when you reach this point.

Good luck.