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
This feature request is a bit complicated to read and follow, but fascinating:
There is the interesting use case of using a Table MultiSelect in DocType 1 (here: Loan Type) as source / list of allowed values in a Select or Link field in DocType 2 (here: Loan).
This aims at narrowing down the list of Modes of Payment available for a specific Loan Type, allowing Loans of that Loan Type to select only from this reduced list.
The same applies to Party Types, Territories, etc., making this a pattern that could be applied in various scenarios. I’m absolutely positive the pattern would soon be used in ERPNext and custom projects as well.
The desired structure fascinatingly kind of works, see the Table MultiSelect source field in Loan Type:
… and the dependent Select field in Loan:
One of the two reasons (for the other one, see the last few paragraphs) it only almost works is as follows:
The dependent Select field gets actually readable values only because in the child table “Loan Type Modes of Payment”, I’m configuring the field value as naming rule:
This however necessarily turns the field unique. This in turn will in most cases be a bad idea because the same values can’t be selected for another Loan Type:
(If you want exclusivity, that‘s the way to go. But here we don‘t want only a single Loan Type to allow for Wire Transfer.)
So instead, we may reset the child table’s naming rule to Random (or Autoincrement). This immediately fixes our problem: exclusivity is gone. It however creates a new problem: now the values offered in Loan‘s select field are identified by a random string:
Again, there could almost be a solution: the title field and “Show Title in Link fields“:
Almost, but not quite—child table doctypes lack these settings, as the entire ‘Settings’ tab is absent.
Now, while in the UI it is not possible to configure these, in the JSON file I can still set:
It’s still a bit rough, as we’re linking to the child table item instead of directly to the original Mode of Payment item:
But again, we’re close.
If we only could use a Select rather than a Link field, so only the actual string values are taken into account, we’d be 100% there. But again, that’s not possible, because Select fields only allow for a static list of values listed one by one in the doctype.
Now I’m wondering how we may remove one or two of the remaining road blocks to make the interesting use case feasible without any custom JS code!?
The text was updated successfully, but these errors were encountered:
My first idea how to solve it, would be a property pass_through or “Pass through from Link source” in the child table to do exactly this.
Then again, I’m unsure if there may ever be a useful case of not passing through the original values. If not, it may be preferable to just always do it.
Another option might be allowing a Table MultiSelect to be source for a Dynamic Link field’s options.
I will investigate both routes but would love to see comments by others indicating to me someone else is interested in a solution.
This feature request is a bit complicated to read and follow, but fascinating:
There is the interesting use case of using a Table MultiSelect in DocType 1 (here: Loan Type) as source / list of allowed values in a Select or Link field in DocType 2 (here: Loan).
This aims at narrowing down the list of Modes of Payment available for a specific Loan Type, allowing Loans of that Loan Type to select only from this reduced list.
The same applies to Party Types, Territories, etc., making this a pattern that could be applied in various scenarios. I’m absolutely positive the pattern would soon be used in ERPNext and custom projects as well.
The desired structure fascinatingly kind of works, see the Table MultiSelect source field in Loan Type:
![IMG_1660](https://private-user-images.githubusercontent.com/46800703/270808236-e34dcffe-3c1e-490d-afec-5350d48e7e94.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTM4NzMsIm5iZiI6MTcxOTgxMzU3MywicGF0aCI6Ii80NjgwMDcwMy8yNzA4MDgyMzYtZTM0ZGNmZmUtM2MxZS00OTBkLWFmZWMtNTM1MGQ0OGU3ZTk0LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMVQwNTU5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02ZDg3Njk0ZTU1OGExOWY4ZjZmMmIwYjM5NTA1NTgwYzE0YTI3ZDgyY2ExMTI5ZjAyNDBiNDAwZWI4NTA2ZDhlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.EeaDVsm4BcRmxA8KMuPKSDmvCHGYOOnj17qDGW-QrwA)
… and the dependent Select field in Loan:
![IMG_1659](https://private-user-images.githubusercontent.com/46800703/270808613-44131120-afe1-4fb9-aa52-b6a6ee4803b7.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTM4NzMsIm5iZiI6MTcxOTgxMzU3MywicGF0aCI6Ii80NjgwMDcwMy8yNzA4MDg2MTMtNDQxMzExMjAtYWZlMS00ZmI5LWFhNTItYjZhNmVlNDgwM2I3LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMVQwNTU5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYzJlZDE5YTliMjdkNGE1MmNkNmE2Zjk0YjNiZWIyMzdhNzY5ZWQyNzUyZTQ5MjI5Y2Y0OWI1ZmQyNGQwODliJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.BoFX3HvChWqy5q_G8oATSKYuV8soKyPoKzdKhmAhMTU)
One of the two reasons (for the other one, see the last few paragraphs) it only almost works is as follows:
The dependent Select field gets actually readable values only because in the child table “Loan Type Modes of Payment”, I’m configuring the field value as naming rule:
![IMG_1661](https://private-user-images.githubusercontent.com/46800703/270809690-d4fd6f52-fc0e-42eb-a9af-e6aa1766f482.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTM4NzMsIm5iZiI6MTcxOTgxMzU3MywicGF0aCI6Ii80NjgwMDcwMy8yNzA4MDk2OTAtZDRmZDZmNTItZmMwZS00MmViLWE5YWYtZTZhYTE3NjZmNDgyLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMVQwNTU5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04OTUxMGYxOTEzZjRjOTRiM2I5ZTI3OGFhMjgxN2NiZDdmNWI4ZjZhMWMzMzhkNGE2YmZkNDcxYjg0MDUyN2Q1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.AECv-LCC5Jq6gDhRBkwZoFmzZsySRwRtlmRrS1Q7kzo)
This however necessarily turns the field unique. This in turn will in most cases be a bad idea because the same values can’t be selected for another Loan Type:
(If you want exclusivity, that‘s the way to go. But here we don‘t want only a single Loan Type to allow for Wire Transfer.)
So instead, we may reset the child table’s naming rule to Random (or Autoincrement). This immediately fixes our problem: exclusivity is gone. It however creates a new problem: now the values offered in Loan‘s select field are identified by a random string:
![IMG_1662](https://private-user-images.githubusercontent.com/46800703/270812083-52f47c37-100c-43df-9c54-755438524ce1.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTM4NzMsIm5iZiI6MTcxOTgxMzU3MywicGF0aCI6Ii80NjgwMDcwMy8yNzA4MTIwODMtNTJmNDdjMzctMTAwYy00M2RmLTljNTQtNzU1NDM4NTI0Y2UxLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMVQwNTU5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZDc3ZDMyYThkMDY2ZDk2Mzg0MDlmMjVhM2ExYTk1NWVjOWEyMjgxYjZmODk2OTVkNWQzM2UxYzRlMmVmM2M3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.t4HDxB2WjElJlCqvD2TXV2zN4RtnMdWRWTE1vknhfYk)
Again, there could almost be a solution: the title field and “Show Title in Link fields“:
![IMG_1663](https://private-user-images.githubusercontent.com/46800703/270812431-1aae0dbf-f4c6-4247-8625-83ccec460916.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTM4NzMsIm5iZiI6MTcxOTgxMzU3MywicGF0aCI6Ii80NjgwMDcwMy8yNzA4MTI0MzEtMWFhZTBkYmYtZjRjNi00MjQ3LTg2MjUtODNjY2VjNDYwOTE2LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMVQwNTU5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MDQzZTA3ZjY2YTExNzVmMGM2Y2FjMzc0NTBhYTg0YzU1ZTc5OTU1ZDI4ZWRmM2UzMTM5ZjRmNWUzMjJkNDUyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.8ObKofu88PFjzf_Lu5yfeADfsNQLdJ9oMtPg2PvSrl4)
Almost, but not quite—child table doctypes lack these settings, as the entire ‘Settings’ tab is absent.
Now, while in the UI it is not possible to configure these, in the JSON file I can still set:
There we go:
![IMG_1664](https://private-user-images.githubusercontent.com/46800703/270816099-8503a793-eef2-4e34-b242-8a09b95dc119.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTM4NzMsIm5iZiI6MTcxOTgxMzU3MywicGF0aCI6Ii80NjgwMDcwMy8yNzA4MTYwOTktODUwM2E3OTMtZWVmMi00ZTM0LWIyNDItOGEwOWI5NWRjMTE5LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMVQwNTU5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xNzgyMmI1N2Y4ZGE5Mzc1MTkzYjNjMTc4OTNiMzRiNThmYmE3ZjY3ODBlYzA2MzkyNzU5N2M5ZTVmZDA4MWZhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.0ALNHx34km1C_X0o5FkbTaL0KtvHfxSL6O-fk73IA94)
It’s still a bit rough, as we’re linking to the child table item instead of directly to the original Mode of Payment item:
![IMG_1665](https://private-user-images.githubusercontent.com/46800703/270818135-a3be469e-60c9-47a6-bffd-a842745a1f04.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4MTM4NzMsIm5iZiI6MTcxOTgxMzU3MywicGF0aCI6Ii80NjgwMDcwMy8yNzA4MTgxMzUtYTNiZTQ2OWUtNjBjOS00N2E2LWJmZmQtYTg0Mjc0NWExZjA0LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMVQwNTU5MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hYjUxMTkwYzI2YjI2MzJiZDAxYTI5ODY5MDA0ZmEwNTA2MjAyYWZjYjczZTFkZDdmZTJkNTk4NDFhNDgyZDQ2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.c89ZjbHQk9SdCPRONATL-klM0Rh8rlfFQ6PbnxL9CIg)
But again, we’re close.
If we only could use a Select rather than a Link field, so only the actual string values are taken into account, we’d be 100% there. But again, that’s not possible, because Select fields only allow for a static list of values listed one by one in the doctype.
Now I’m wondering how we may remove one or two of the remaining road blocks to make the interesting use case feasible without any custom JS code!?
The text was updated successfully, but these errors were encountered: