New Sample - Using Subform as Open Related Dialogue with multiple returns (Ver. 8.2.0.1686)
Download "Open Related" Sample
Open Related is a "awkward" and outdated way of doing "picklists". As you have pointed out it is slow and you can only really return one value, but the biggest problem is the relational aspect itself.
When you open Related with a blank Relational key it is fine, then you can search and re-search and find the correct record, but if you then want to change a row and open again, then the relational constraint hit you in the head and you can only select what you have already selected.
A way around this is of course to clear the relational key before you make the "jump" but you still have all the original problems and what if you "change your mind"?
Anyway, this is a good opportunity for us to showcase new and exciting ways of solving this in DE8.
Please find attach a sample that should show case how to solve your question and many un-answered questions too.
It is not a finished item, it is meant as inspiration of functionality so a lot of "issues" still needs ironing out.
We exploit a lot of "loopholes" in DE architecture here like using Form Virtual fields that can now be editable (inputs). You could for instance use one like that in the Stock Subform to add quantity. You can't reference form virtual fields directly in Derivations etc, but you can pick the value out of it with GetValue() and the brilliance of them is that you can define them anywhere....
To hide "empty rows" and toggle between the Pick and Del buttons we simply use the ValueLoaded event on ArticklNr. So have a look in the OML event for the code.
The fields in Stock and Orderlines are called the same and that causes a lot of problems with OML so here we also get to show you how useful it is that you can change the Object name in the form. We added Stock in front of all the objects in the Stock subform to get the distinction.
Manip Virtual field is again a big clue in this app.
The search feature in Stock we achieve by manipulating the relationship (key) in main record from Subform with SetValue... quite cool.
We did it on a button for visibility but you could equally do it on a OML event etc.
Our job is not to do the job for you but inspire you to do the job, so we need to stop here when there is plenty enough for you to do ;-)
Hopefully it will be a help and inspiration...I don't know about you, but after you get you feet wet in DE8 programming previous DFW development feels quite drab and soulless ...he,he
PS! This sample only took an hour to make, so DE is definitely back in the RAD camp.