How to export specific custom field in specific custom app

Here an example:
App 1:
|__ custom_field “field_A” in “Purchase Order”

App 2:
|__ custom_field “field_B” in “Purchase Order”

here if i export customizations then field_A , field_B both fields comes into app which i selected for export i want field_A app in App 1 and field_B in app App 2

Hi there,

To ensure the custom field appears in the correct application, please navigate to the Custom Field List and update the “Module (for export)” field to match the desired module name.

Thanks,

Divyesh Mangroliya

1 Like

by using “Module (for export)” all fields from both apps comes into both json files i want specific field in specific json but it did’nt worked …

Here an example:
App 1:
|__ custom_field “field_A” in “Purchase Order”

App 2:
|__ custom_field “field_B” in “Purchase Order”

here if i export customizations then field_A , field_B both fields comes into app which i selected for export i want field_A app in App 1 and field_B in app App 2

in custom file of purchase order of App 1 i want field_A in purchase order json bt after exporting by using “Module (for export)” from custom field both fields comes into App 1 and for App 2 its happening same

Check this; you can apply a filter for exporting fields. I have given an example of exporting a specific workspace; you can apply a filter for custom fields.

You should provide modules for all custom fields in the custom field doctype.
Then you should add fixture hooks for custom fields on both your custom apps with the proper filters for modules.
This way the json will be created per app with its own custom fields.

App 1 hooks.py

fixtures = [
    {
        "doctype":"Custom Field", "filters":{"module":["in",["module_1"]]}
    }
]

App 2 hooks.py

fixtures = [
    {
        "doctype":"Custom Field", "filters":{"module":["in",["module_2"]]}
    }
]

Then in the terminal you need to give

bench --site site_name export-fixtures

if i have more custom fields then ? and how to export column break and section break

Column breaks and sections breaks will also be created as a record in the custom field doctype. Just give the proper modules for them and export fixtures. This will allow the fields to be added to the app. When you install the app or migrate it the fixtures will get added.

1 Like