A PCF subgrid to check off related items quickly

By | June 16, 2019

 

Sometimes, all we need from a subgrid is to show us the list of checkboxes.

For instance, imagine an inspection entity. A vehicle inspection maybe… Every inspection would have a list of standard inspection items associated with it. If only there were an easy way to check off all those items quickly.

Of course we can use an out-of-the-box editable subgrid, but, surprisingly, it does not support “checkboxes”. For the two-option fields, we will only be able to see yes/no dropdowns in such a subgrid.

That, of course, will make the whole process way more click-consuming than it should be.

So, what if we could do something like this:

pcfcheckboxlist

I probably can’t, really, call it a production-ready control yet since there are a few assumptions made there which are not too flexible:

  • The underlying view selected for the subgrid has to have exactly two columns
  • The first column would be anything, and the second column would be a two-option field
  • This control does not support paging, so the subgrid  should be set up to display enough rows
  • Those “pass”/”fail” are not configurable yet
  • There is no “add” button – the idea is that, in that example with vehicle inspections, all the “subitems” will be added to the parent record through a workflow so there is no need to add/delete anything using this control

 

And, besides, it might not reflow too well.

Actually, what I just wrote perfectly illustrates a couple of things:

  • PCF has great potential
  • However, PCF is for developers. Even more, if you want to get good results quickly, you may need good front-end developers

That said, the control above is functional, so, if you wanted to see the code and/or if you wanted to try the control, here is how you can do it.

There is a github repository: https://github.com/ashlega/ITAintBoring.PCFControls

You will find this control in the Controls/CheckBoxList subfolder

If you only wanted to download the solution file, you’ll find it here:

https://github.com/ashlega/ITAintBoring.PCFControls/tree/master/Controls/Deployment/Solutions

That solution file includes one more control, too (have a look at my other post: https://www.itaintboring.com/dynamics-crm/pcf-controls-now-i-have-my-first-pcf-control-too/ )

It should be easy to set it up(just remember to use a view with two columns – the first one for the “name” and the second one for the two-options field) :

image

Leave a Reply

Your email address will not be published.