Fetching Data from another doctype based on field
This snippet works on Doctype `Sales Invoice`. It looks into the `Address` doctype and searches for the ID/`name` that is equivalent to the current form (cur_frm.doc.) `shipping_address)name` field, since those should be equal as the `shipping_address_name` field is a link type field. Then it pulls the `zone` field from there.
The second part parses the response data to just pick the desired `zone` field data. Good to have Developer Console running to see the logs.