O'Reilly logo

Microsoft Dynamics NAV 2009 Programming Cookbook by Matt Traxinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the debugger

This recipe will show you how to use the debugger to examine the code that is currently executing. We will demonstrate how to go through the code line-by-line and watch how values and objects change.

How to do it...

  1. Create a new codeunit from Object Designer.
  2. Add the following global variable:

    Name

    Type

    Subtype

    Customer

    Record

    Customer

  3. Add the following global text constant:

    Name

    ConstValue

    Text001

    Matt Traxinger

  4. Add a global function called ChangeCustomerName.
  5. The function should take in the following parameter:

    Name

    Type

    Length

    NewName

    Text

    50

  6. Add the following code to the function:
    Customer.Name := NewName;
    
  7. Add the following code to the OnRun trigger:
    Customer.FINDFIRST; ChangeCustomerName(Text001); Customer.VALIDATE("Post ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required