Doctype Layout - adding a field

I’m trying to use Doctype Layout to customize the layout of the Leads document, and I’m running into problems. My primary goal is to add a section and column and reorganize fields into the new section. I figure the Doctype Layout document isn’t advanced enough to do that on it’s own, so I added a the section and column break to the form via Customize Form.

First a significant issue with the form:

It isn’t possible to select the Fieldname in the Fields table and fill out the form manually, because the Fieldname doesn’t display any fields in the dropdown. The workaround for this is mentioned here, which I followed with some success.

I have seen the dropdown populated with fieldnames seemingly at random, but to date I haven’t been able to determine what triggered the effect.


With that out of the way, here is my issue: after adding a field via Customize Form, is there any way to add the field to the Document Layout form? There is significant customization in the form already, and starting over is very time-consuming and error-prone. Maybe someone knows what triggered the dropdown to fill out?

2 Likes

Did you figure this out?
As your link says you have to:

  1. Create the New layout and fill in the Name, Document Type and Route
  2. Remove the empty field row from Fields
  3. Try to Save
  4. Add a Row to Fields

And all of the fields will be copied over.
But it doesn’t seem to happen twice, so you have to either:

  • start from scratch with a new Document Layout
  • add in the fields manually

It seems the only way the fieldname dropdown is populated for adding fields manually is:

  • Do a browser refresh of the Document Layout to make sure new custom fields are fetched
  • On the first page of fields, Edit an existing field
  • Use the Insert Below, Insert Above or Duplicate buttons

Et voila the drop-down appears.

Then you can move the field using the Move button or click and drag the field number in the child table.

Maybe you can help me though… Once I’ve modified a layout, it just goes to the standard doctype form. Is there a trick with changing the URL to the new Document Layout route?
Or maybe I have to do a clear-cache or something?

Found the answer here:

  • The route needs to be /app/standard-route/ e.g. /app/sales-order/
  • The Name should match the Doctype Name, otherwise the Go to button takes you to a new list page
  • If on a production-configured site, you also need to do a bench --site <site> clear-cache after the layout is saved