Fetching data from custom filed to another field

Hi

I’ve created a new field in customer records called Freight Automation code, and be able to fetch the data from that field to a field in delivery notes.
I’ve tried using customization form, however fetching isn’t just happening.

Details are below,

Customer
Field Name: Freight Region Code
Field Data – List:
12
A3
AE etc.

Delivery Note
Field Name: Freight Region Code
Field Data: Fetch from customer record.

Could you please help me in setting this up?

You would have to set up a custom script to fetch the value. For example:

cur_frm.add_fetch("customer","freight_region_code0","freight_region_code1");

Where “customer” is the DocType you are referencing, “freight_region_code0” is the field in customer, and “freight_region_code1” is the field name in Delivery note you wish to propagate.

Thanks Cattmy for immediate response, Could you please also let me know where from to setup the custom script?

In the Setup Module as “Custom Script”

Thanks. I’ll try it.

Hi, I have a question - I found this - https://frappe.io/docs/user/en/guides/app-development/fetch-custom-field-value-from-master-to-all-related-transactions

Erp Next is based on frappe so why I must do a custom script and not to use this? Because this posted solution is not functional in ERP.