Where to place my code?

That's the question… Many rookies have problems with decision where to put the code (or from where to call it). When you watch some beginner in NAV where the code is placed and from where it is called, you can find out that in many cases used triggers are the triggers, which in 99% are not used in the application and many Pro developers nearly do not know what the triggers are doing :-).

I had a thought. To create small decision tree which can help developers to find out, which trigger will be best for calling the code, and where to place the code in (table, codeunit etc.). I placed the first file to google code repository site under project named "The Art of NAV". I will try to keep this site as the Home page of this project. We will see, maybe I will find better tool for that.

I am waiting for your opinions and comment. I will try to keep the project live and up to date. We will see, if it helps you.

This is a first step I am doing and I am thinking about it as an initial step for something I am calling "NAV Art" or "The Art of NAV". My target is to help all developers to make the code as clear as possible and make some order in the NAV word. Of course, there is no simple manual or something for that, but I want to open some discussion about that and give some ways for the specific problems. I hope that I am not alone in that and you all will try to participate in this.

I am Waiting for your comments...

Decision tree

Decision tree for table

Published Mon, Jul 28 2008 1:06 by kine

Comments

# re: Where to place my code?

Hi Kine, wow - it's been a few months since you posted - good to see you back.

I'm all for this idea of bringing order to the world of NAV. It would be nice to see the "Isn't codeunit better?" replaced with some decisions that would help us understand what makes a codeunit better.

Also these diagrams don't look too good on the web site and are a bit tricky to read - maybe you could save them with a bit higher resolution or in a different format?

The first diagram - it isn't immediately obvious where to start - it would be nice to have the first box always being something like "Where do I put my Code?"

It would be interesting to see what the Rookies think - I'll ask some new starters in my team to take a look and leave a comment.

Monday, July 28, 2008 4:13 PM by David Roys

# re: Where to place my code?

Great idea! I have raised this question with my mentor more than once in my short time as a NAV Developer.

Monday, July 28, 2008 4:28 PM by Michael

# re: Where to place my code?

Hello David,

I know that many things in the diagram are not clear or just "to be there", but take it as a first version. I am waiting for comments like yours to make it better.

You can download the Visio diagram from the link in the article. Images in the article are just examples. In the visio file there are other diagrams too(Reports, Forms...). On the google code site, there are the images in full quality (200DPI) if you need them...

Tuesday, July 29, 2008 12:10 AM by kine