If I want to have the ‘name’ of a document be based on something like “Truck VIN”, I can create a field truck_vin, and then have the naming for the doctype be based on that field:truck_vin.
Great! That all works fine.
But if I want to have a <th> in the list view with “Truck VIN” instead of “Name” then I have to add the “Truck Vin” field to list view settings.
However, since “name” is not removable from the <th>list, the following columns are shown when I only want a single column…
Name | Truck Vin | Name
(all 3 fields being the same thing).
That’s silly.
Why is “Name” being repeated at as the last <th> anyway? Isn’t one forced non-removable “doc.name” field enough?
Questions…
Is it possible to change the label/display name of name field? (for list view table header)
Is it possible to remove the repeating ‘name’ field at the end of the list view?
Check if you’re in developer mode (developer_mode: 1 in /yoursite/site_config.json)
Sign in as the Administrator
Make sure your Truck doctype does not have the ‘Custom’ box checked
Navigate to bench/apps/your_app/the_module/doctype/truck/
4a. If you haven’t created your own app, you should to save your customizations. Follow the instructions in bench new-app. Make sure you install it after you create it (bench install-app your_app)
4b. The tutorial is absolutely worth your time and will save you days of frustration starting in the near future.
‘Custom’ in this context means that the definition for this doctype will only exist in the database and that schema for it will not be saved with the application. If you want to have any business logic associated with Truck (it is very likely you will), you are better off using the scaffolding Frappe provides.
Sorry… still not clear to me. “will not be saved with the application” Will I lose data? or records of trucks if [x] custom is checked?
Using the scaffolding frappe provides = unchecking doctype custom?
Before responding I tried to read about this [x] custom elsewhere too, but it’s confusing what it actually does. I think for all of my doctypes that I created, I selected custom because I thought it was custom.
This field is poorly labeled. Frappe is designed so that your custom doctype can exist only in your database or you can associate it with your application. By using an application you gain version control over your app.
Using the scaffolding frappe provides = unchecking doctype custom?
Yes. Frappe will create all the files you would need to execute logic around your doctype. This allows you to keep your changes in version control, which is the tooling you need to use if you want to have multiple instances of your app (development and production, for instance).