You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When implementing a Dynamic Link field, the options source may either be a Select or a regular Link field.
Now if the source is another Link field, there is the additional requirement that this other Link field must have “DocType” as its options source.
This rule is enforced by Frappe throwing an exception so the DocType can’t be saved. The relevant code may be found here.
This second rule is overly strict and should at least be expanded a bit to also allow meta DocTypes such as Party Type. Fact is that it does work really nicely without any problems if specified directly in the JSON file.
You just can’t save the DocType in the UI editor anymore, for this exception being thrown:
RPReplay_Final1695389909.mov
But if implemented in JSON, it works quite well, just as expected.
Basically Party Type works as a pre-selection filter that allows handpicking a couple of the many, many DocTypes so you don’t have to specify them statically in a select or provide them by custom JS code:
RPReplay_Final1695391020.mov
There are already a few usecases particularly for Party Type, including in frappe/lending. I can imagine this to be a quite powerful thing to do in other cases as well.
So I think we should slightly loosen the enforced rule to (officially) allow this to be done. But of course we need to be careful and find out what exactly is needed to ensure a Dynamic Link field doesn’t break. And then we need to figure out how to put this into words, so power users understand it better, not worse than today.
The text was updated successfully, but these errors were encountered:
bosue
changed the title
Allow Dynamic Links to obtain its options from a specific DocType, not necessarily from the full list of DocTypes
Enable Dynamic Links to obtain its options from a specific DocType, rather than all DocTypes.
Sep 27, 2023
When implementing a Dynamic Link field, the options source may either be a Select or a regular Link field.
Now if the source is another Link field, there is the additional requirement that this other Link field must have “DocType” as its options source.
This rule is enforced by Frappe throwing an exception so the DocType can’t be saved. The relevant code may be found here.
This second rule is overly strict and should at least be expanded a bit to also allow meta DocTypes such as Party Type. Fact is that it does work really nicely without any problems if specified directly in the JSON file.
For an example, please see what is being done in frappe/erpnext#37195.
You just can’t save the DocType in the UI editor anymore, for this exception being thrown:
RPReplay_Final1695389909.mov
But if implemented in JSON, it works quite well, just as expected.
Basically Party Type works as a pre-selection filter that allows handpicking a couple of the many, many DocTypes so you don’t have to specify them statically in a select or provide them by custom JS code:
RPReplay_Final1695391020.mov
There are already a few usecases particularly for Party Type, including in frappe/lending. I can imagine this to be a quite powerful thing to do in other cases as well.
So I think we should slightly loosen the enforced rule to (officially) allow this to be done. But of course we need to be careful and find out what exactly is needed to ensure a Dynamic Link field doesn’t break. And then we need to figure out how to put this into words, so power users understand it better, not worse than today.
The text was updated successfully, but these errors were encountered: