Is it a multiselect optionset? Nope… it’s an N:N lookup
If you ever wanted to have your own multiselect optionset which would be utilizing an N:N relationship behind the scene, here you go:
It works and behaves similarly to the out-of-the-box multiselect optionset, but it’s not an option set. It’s a custom PCF control that’s relying on the N:N relationship to display those dropdown values and to store the selections.
Turned out it was not even that difficult to build this – all that was needed is to combine Select2 with PCF
The sources (and the solution file) are on github: https://github.com/ashlega/ITAintBoring.PCFControls
This is the first version, so it might not be “final”, but, so far, here is how this control is supposed to be configured:
Linked Entity Name: “another” side of the N:N
Linked Entity Name Attribute: usually, it would be “name” attribute of the linked entity
Linked Entity ID Attribute: and this is the “Id” attribute
Relationship Name: this is the name of the N:N relationship (from the N:N properties page)
Relationship Entity Name: this is the name of the N:N relationship entity name (from the N:N properties page)
Some of those properties could probably be retrieved through the metadata requests, but, for now, you’ll just need to set them manually when configuring the control.
This was originally posted here.

Like
Report
*This post is locked for comments