Field is not displaying when refreshed

I am having a doc type named ECP and ECN, I created a custom button called Create ECN in ECP and it will go to ECN

Once Create ECN button is clicked, ecp_number will auto populate in ECN.

The issue is once I refresh ECN , ecp_number field is not displaying.

Actually ecp_number is readonly. It will have value because once ECP is generated only we can create ECN through custom button.

This is my written code.
refresh: function(frm) {
// Check if the current user is the ECN owner and show the ‘Create ECN’ button accordingly
if ((frm.doc.status === ‘Approved’ || frm.doc.status === ‘Rejected’) && frm.doc.ecn_owner_mail_id === frappe.session.user) {
// Show the “Create Fimer ECN” button
frm.add_custom_button(__(‘Create Fimer ECN’), function() {
// Open the Fimer ECN form with the ECP number auto-populated
frappe.new_doc(‘ECN’, {
ecp_number: frm.doc.name,
ecn_owner_mail: frm.doc.ecn_owner_mail_id,
ecp_initiator_mail: frm.doc.ecp_initiator_mail_id,
reporting_manager_mail: frm.doc.repo_to
});
});
Is there any solution?