Get data from doctype to anther doctype by add_custom_button not working

hello , I have book hotel doctype with label name hotel_name
I want add button in doctype using add_custom_button with value PreBook Hotel
when I select Prebook it’s map hotel name (for now and testing)

please I need steps (on any simple example - not huge to understand it because I am new in python & ERPNEXT ) and if I need to need use controller ? if yes how to create very simple controller just to run above task.

best regards ,
thanks ,

For the reference, you can check how it checks for the Doctpr’s availability in the Patient Appointment Doctype.

https://github.com/frappe/erpnext/blob/develop/erpnext/healthcare/doctype/patient_appointment/patient_appointment.js#L72

1 Like