Erpnext how to select another doctype as a value to another doctype?

I’d like to create a doctype that uses another doctype as a selection such that f.e. user could select a existing customer to a selling invoice from a dropdown menu. How this can be done? I have seen this functionality somewhere before.

You can learn that here: https://frappeframework.com/docs/user/en/tutorial