Hello,
I am trying to add a custom button on a doctype that will trigger the add_fetch function.
I am able to use the add_fetch
alone, use the button to display an alert or to fill a field with text but not to fetch data from another doctype.
Here is my script today:
My button is called “get_po_details” and I chose the related PO in the “related_po” field (link type with POs) I created.
cur_frm.cscript.get_po_details = function(doc) {
cur_frm.add_fetch(‘related_po’,‘country_of_origin’,‘country_of_origin’);
cur_frm.add_fetch(‘related_po’,‘destination’,‘destination’);
cur_frm.add_fetch(‘related_po’,‘destination_2’,‘destination_2’);
}
Am I missing something?