While the Mendix modeler makes a lot of heavy lifting easy for you, there are some areas where if you apply a little discipline, can make your workflow of adding forms faster and keep your project cleaner.
Custom forms on grids
A common pattern I find is that engineers tend to place microflow triggers on data grids for launching custom forms in lieu of the garden variety new/edit buttons. For instance, a specialised view form.
The microflow behind the button contains a single action, that of showing a form. Usually this is okay if what you want is to display one of many forms based on logic or you want to pre-populate the form with a custom created object. In most cases however you are likely to display a single form that is neither a New or Edit form.
By using microflow buttons you end up with an overhead of 1 microflow for each custom form. This is a waste and bloats our project. I’m going to show you how you can throw away that microflow trigger and keep thing simple.
The better way
Instead of adding a microflow button, you right-click on the grid widget’s control-bar and add an “Edit” button. Now all you need to do is select your custom-action’s form, change the label and change the icon. Viola, its as easy as that.
You might ask yourself why this is important? By removing that unneeded microflow from our project, it helps us keep things cleaner and a clean project helps us maintain things when the model grows. Its one less microflow to worry about.
Like Formula1, performance gains aren’t in quantum leaps, its a 0.5% enhancement here and a 1.7% improvement there that adds up in the end that makes your car drive a little faster than the next.
You will also notice that clutter slows down a large project and takes you longer to navigate to a desired location, not to mention searching through things slow you down when there are too many items with similar names.
As Niki Lauda said, “Because to be a champion it takes more than just being quick, it’s the whole picture.”