frappe_docs icon indicating copy to clipboard operation
frappe_docs copied to clipboard

Better documentation on the "Fetch From" doctype row option

Open ollyboy opened this issue 4 years ago • 3 comments

When using a "select" type in DocType1 to pull in the name of another Doctype2. image

We often want to collect other information from Doctype2 via the "Fetch From" feature.

image

The correct use of "Fetch From" is to use the "name" of the Doctype1 select field populated and not the name of the source Doctype ie

  • stratigic_intent.period_version is wrong and will return no results
  • intent.period_version is correct and will work

This is not clear from the examples/documentation on the net. In many examples the DocType1 field name is the same as the docType2 doc name, this will always work but that's more good luck than knowledge.

ollyboy avatar Nov 18 '20 22:11 ollyboy

Related docs: https://frappeframework.com/docs/user/en/guides/app-development/fetch-custom-field-value-from-master-to-all-related-transactions

Source: https://github.com/frappe/frappe_docs/blob/master/frappe_docs/www/docs/user/en/guides/app-development/fetch-custom-field-value-from-master-to-all-related-transactions.md

barredterra avatar Dec 14 '20 18:12 barredterra

Hi thanks. Found those docs, the issue for me was the "field" name link in my app was different from the source docType name. In the examples, they are both the same.

ollyboy avatar Jan 31 '21 18:01 ollyboy

Great! Feel free to edit the docs, create a PR and request a review from me.

barredterra avatar Feb 01 '21 14:02 barredterra