I have created a Web form
frappe.ready(function() {
// bind events here
frappe.web_form.on('flight', (field, value) => {
frappe.call({
method: "frappe.client.get",
args: {
doctype: "Airplane Flight",
name: value // Fetch based on value entered in the field
},
callback: function(r) {
if(r.message) {
// Fetch Airport data
frappe.web_form.set_value('source_airport_code', r.message.source_airport_code);
frappe.web_form.set_value('destination_airport_code', r.message.destination_airport_code);
// Fetch shedule and time details
frappe.web_form.set_value('departure_date', r.message.date_of_departure);
frappe.web_form.set_value('departure_time', r.message.time_of_departure);
frappe.web_form.set_value('duration_of_flight', r.message.duration);
}
}
});
});
})
and used this code to Fetch data from link field
Fetch data is working properly
and even its doctype also
but I am unable to save data using doctype