Productivity tips and tricks when working with Mendix, what are yours?

27
I use a lot of tricks when working everyday with all of the features of the Mendix Platform so I would like to share these with you. Please let me and the community know what your tips and tricks are below (as answer) I deploy from the modeler. Saves switching to the browser, click Create package, select correct branch etc. Just click on Team->Deploy to licensed cloud and press deploy. Only you have to do is transport it to the correct environment. Choosing this would be a nice feature (placed it on the idea forum) Restore full backups from the cloud with a batch script (see scripts). It saves you opening PGadmin, search your database, backup it, delete it, create new, find your backup and restore it. Simply drag your downloaded backup onto the batch script a hit the magic 'Any key' :) Restore databases also with a script. Set you mousewheel on double click or a custom button if you have a fancy gamers mouse ;) Learn to do as much as possible with your keyboard. Ctrl+Enter is I guess the most used combination I use during the day (inspired by https://www.mendix.com/blog/6-mendix-shortcuts/) Use in the WIndows Explorer the feature Quick access (or pinned folders) and drag your running project folders there for quick access to your projects. With widget development I use grunt or semi automated with a batch script for packaging you widget into a .mpk (see scripts ) Shotcuts in your browser bookmark bar, quickly open your common locations like http://localhost:8080/login.html Turn off e-mailnotifications or check less frequent. E-mail distracts you from focused modelling Greenshot is the best (free) screenshot tool there is (http://getgreenshot.org). It has a lot of features. If you want to attach a screenshot to your userstory press PrntScrn, Greenshot saves it always on the same location (which is also in the Quick Access of the Windows Explorer ;-)) Use a password manager for quick and secure login in your applications. Even during development you can use this. We use LastPass and even share project folders for easy sharing credentials. Trust me this saves a lot of time. I measure my performance, activities and distractions with RescueTime on my work laptop and this gives me interesting insights in my daily work. Do you have more tips or tricks when working everyday with Mendix?
asked
13 answers
14

Ok, here is my bullet list in a random order

  1. Multi project developers: create an entry per project in the hosts file to make password managers more efficient. So you can use http://myapp:8080. without seeing users of other project. (Thanks Benjamin)
  2. Avoid specializations if possible. (And you really need one don't make an association to the generalization entity: no one will understand)
  3. Avoid calculated fields if possible because they are often called, also when not needed.
  4. Avoid Snippets nesting more than 3 deep
  5. Avoid form validations unless for simple ones
  6. Don’t do validations in before commit
  7. Don’t use before and after commit events that will result in cascaded updates. For example calculate the total of a year for every month. Call them explicitly in microflows.
  8. Always setup delete behavior, but do it explicit when needed (huge amount of data combined with multiple levels of associations)
  9. Cleanup unused documents
  10. Solve all warnings. These can help you to find copy-paste errors and other mistakes.
  11. Always think about database size and lifespan of entities: cleanup logging after a certain time.
  12. Try to develop clean Mendix with mostly standard features: this will make your updates easier.
  13. Let a colleague review your work, discuss it.
  14. Stick to your company's single page of Mendix standards
  15. Use FakeSTMP as local mail smtp server. (Thanks Allard)
answered
8

At the Community team we create, maintain and troubleshoot a lot of widgets. Widgets that are in our support category (Extended Support) and if there is time, also the ones that we do not officially support (Community Support). While doing so, I needed some tools to speed up the workflow.

---- Widgets ----

This one uses Yeoman to scaffold a new widget, or add Grunt to an existing widget. Using Grunt, you can for example work on a widget and copy it to your project folder (by changing the project folder in package.json)

This tool was primarly used to get our widgets ready for the MX6 release late in 2015. It runs through an .mpk file (or several at once) and tells you whether or not the widget is using deprecations that will render it useless in MX6. If there is going to be a new release of the Modeler, I am upgrading the checker with deprecations for that as well. It outputs the deprecations to your console, or an Excel file

I am a Linux fan, so i use the terminal a lot (for Grunt, widget generator). I wanted to find a way to open my mendix project using the command-line. Meet mx-modeler. If you run 'mx-modeler -l' it will give you a list of all the installed versions. 'mx-modeler -v x.x.x Project.mpr' opens it with this specific version. 'mx-modeler -c Project.mpr' will tell you in what Modeler version the project is made.

---- Troubleshooting ----

Running "Check widgets" in your Modeler and it fails, but you don't see any output in your logs to pinpoint the problem? Use this 'hack' to get verbose output.

---- Theming ----

For UX people I created a way to leverage Gulp/Grunt (Gulp is preferred because it is way faster) in doing theming. There is one nifty little trick there: If you run 'gulp dev' (and have configured it properly) it will open your browser and runs the project through browsersync. If you make changes to you SASS/CSS files in the theme folder, it will automatically be injected in your browser (without you having to reload the browser).

This is still work in progress and will eventually be available under the Mendix Github organisation.

answered
4

Using an XSD schema to import large Excel files:

https://world.mendix.com/display/tips/Import+a+large+Excel+file

answered
4

Definitely Ctrl + G and Ctrl + Enter, use those a lot.

Bookmark deploy tab

I go to the Overview tab of my project and right click -> copy the url for the Deploy button. Then I make a bookmark for this link, so I can easily get my builds to T/A/P. Same can be done for any other the other links at the top of course.

answered
3

Use PersistentSessions = true in your local configuration to keep your login when you make changes and rerun your application

answered
3

Back with Ctrl+Tab

This is probably such a no-brainer that most of you consider it common knowledge, but I'm always surprised by how few Mendix devs know that Ctrl+Tab while in a modeler tab will return you to the previous tab you were on, much like a back button. This won't move you a tab left or right (like it would in your browser) but actually keeps track of your history and move you to the tab you were on last.

answered
2

Mouse with thumb buttons - custom key mapping/binding

Set one to 'Maximize screen'. This will help during XPath input and modelling in general. I've also mapped mouse wheel click left to '$'. Try it! You'll use it more than you'd think.

Use Anonymous browsing sessions

To combine up to 6 logged in users (IE + FF + Chrome + anonymous browsing sessions per browser). Useful for admin/superuser + specific usergroup testing.

answered
1

We use fakeSMTP to run a local SMTP server for the same use as Ronald.

answered
1

EyeLeo for some scheduled breaks I don't know about you guys, but I tend to sit way too long at my desk without standing up. Therefore I use a tool called EyeLeo to remind me to have regular breaks. Apart from it being healthier, it also is a nice moment to reflect on the work I've done in the past half hour and decide how I'm going to spend my next half hour.

Ditto for CTRL+C history I never want to work without Ditto again. This tool was recommended to me by a colleague. It remembers all of your copied text, and with a simple shortcut you can select on of your previous copies as your next CTRL+V. Real time (and frustration) saver!

f.lux to remove some blue light from your monitor A sidenote to this tool is that it's only useful if you're not doing design work, since the colors on your screen will look different. Apart from that, f.lux has saved me a lot of headaches. Working in low-light areas, or early in the morning/late at night, this tool will recreate the lighting in your room on your monitor.

answered
0

Together with our mendix app comes an API bases on SOAP web services. We created automated tests in soapUI to make sure the API works properly. Once automated tests have been developed, this can be a great timesaver. This articld describes how to add automated tests in soapUI: https://world.mendix.com/display/howto50/Testing%20web%20services%20using%20SoapUI

answered
0

Use SMTP4Dev (https://smtp4dev.codeplex.com/) so you can also test the mail traffic local and do not have to wait a couple of seconds for the mail to fail before continuing the rest of the process.

answered
0

CSS source map

I always turn on the Source map feature on each file in Koala, I'm sure other SASS precompilers have the same thing. Chrome picks up the generated map file.

This allows you to directly inspect and work on the .scss rather than the generated .css. It also makes the standard theme classes way easier to find and override for your needs.

Microflow action captions.

Take the time to put in some meaningful text in your microflow actions. Makes the microflow easier to read. And when something breaks, quite often the log has the action text

answered
0

Here’s what I use most of the time :

Shortcuts

Find  – CTRL + F

Advanced find – CTRL+ Shift + F

Suggestions/ IntelliSense – CTRL + Space

OK/Complete Actions – CTRL + Enter

Close all tabs – CTRL + W

Utilities

SASS compiling (Auto-compile) – Scout (Koala is also an option)

Email capture locally – Papercut

Deployment

I always build and push to the server while asking for any approvals, this saves you the extra 3-4 minutes the code is being moved in between. You can then even navigate off and leave the new version to be deployed with a restart later. 

If you need to roll-back just push the previous version to the environment and you should be back to the original position.

answered