Placement of code

  • February 16, 2010
  • 0 Comments

When you are programming, you have to think about where placing you’re code. Always try to place you’re code nearest to the source so it can be manipulated easily. For instance code that manipulates tables should be placed in that tables methods.

Best Practice: Try to minimize the x++ code in forms for the following reasons:

  • Forms do not support inheritance. You cannot share logic implemented in a form with other application objects.
  • The X++ code implemented in forms is always executed on the client. This means that you cannot tune an application by specifying where to execute the code.