Read Only Field - Custom Fields in Customer Form

I use ERPNext on Docker (version 15) and have been playing around. I have a custom field in Customer called Parent Company which shows the Customer naming series. I want the field to display the customer’s name, not the naming series but I don’t want to change the naming series either. So I figured I can make a display parent Company field where I can display the name of the customer using Server Scripts. However, i can’t understand how exactly I can do this. Can someone give me a step-by-step guide on how I can do this?

Can you clarify what’s your goal?
On customer doctype (which has a naming series field) you added a custom field (called custom_parent_company) that you want to display the naming series value of the customer (which is already stored in the naming_series field) — whats the point of this?

You want it otherwise to display the customer name instead of the naming series (which is also stored in doc.customer_name or whatever the name field is)

So what’s the point of this custom field?


Edit: maybe you are trying to automatically get the parent company of a customer based on its naming series? If that’s the case,

  • on your “Company” doctype add a custom field to store the value of the naming_series_prefix
  • add a custom link field (custom_parent_company) in the “Customer” doctype that link to company.
  • add a hook to match the customer’s naming series with the naming_series_prefix with the correct company then assign the value to the custom_parent_company

Note: I do not work with ERPNext and there might be a cleaner already native way (since it supports multi-company)