It was great to see how N:N lookup PCF control has sparked some interest, but there are still a few things that could(and probably should) be added.
For example, what if I wanted to make it work when creating a new record? Normally, a subgrid won’t event show up on the new record form. But, in the updated version of the N:N lookup, it’s actually possible now:
So, where is the catch?
The problem there is that there is no way for the PCF control to associate anything to the record being created, since, of course, that record does not exist yet. But, I thought, a “post operation” plugin would certainly be able to do it:
If you wanted to try it, here is what you need:
- All the code is in the git repo: https://github.com/ashlega/ITAintBoring.PCFControls
- There is a solution that has all the PCF controls (and a plugin)
- There is, also, a solution that includes a few demo entities and an SDK step
NToNMultiSelect control has been updated, too
You can use the same approach with any entity, just keep in mind a few things.
NToNMultiSelect is supposed to be bound to a single line text control. I should probably change this to “multiline”, but, for now, that’s what it is. Since this control is passing JSON data through that field, the field should be long enough (2000 characters). Yes, there is still room for improvement.
Also, you will need to register a plugin step on each entity which is using this control:
It should be registered in the PostOperation, and it should be synchronous.
The plugin will go over all the attributes, and, if any of them includes data in the required format, it will parse the data, and it will create required record associations.
That’s it for today – have fun with the Power! (just testing a new slogan here )