O'Reilly logo

Microsoft Dynamics NAV 7 Programming Cookbook by Rakesh Raul

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. First create a new codeunit from Object Designer.
  2. Then add the following global variable:

    Name

    Type

    Subtype

    Customer

    Record

    Customer

  3. We need to add the following global text constant as well:

    Name

    ConstValue

    Text001

    Rakesh Raul

  4. Add a global function called ChangeCustomerName.
  5. The previous function should take 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; ...

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