How to select specific doctypes that will hold values using dynamic link field

Good day
i want to specify some doctypes that will be fetched using the dynamic link field. I don’t want all the doctypes to be fetched. please I need your help
dynamic%20link

You can add a Custom Script in order to get the desired output.

For the filter query, refer this:
https://frappeframework.com/docs/user/en/guides/app-development/overriding-link-query-by-custom-script#1-adding-filters

hi @harshit-30 can you help me on how to fetch data on a parent doctype and encode it on the child table using a dynamic link?

I was trying to fetch the data on a custom field on the parent doctype of the Sales Invoice then encode it on the child table payment entry references.

This is same on how the Supplier Invoice No. works. When the dynamic link is a Purchase Invoice, a supplier invoice no. field will be visible.