Not sure why Mohana suggested that link.
Since it's version 2013 R2, then he gave the "correct" answer in his own blog:In NAV 2013 R2, this is standard setup, no need for code.
The developer in me first looked on your code... [;)]
Then it hit me. Even NAV 2013 had the setup that does it for you.
Check out Mohana's post here:
Although your code is easy to do and implement, then nothing beats a standard setup field that…