Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Microsoft Dynamics NAV 7 Programming Cookbook
Microsoft Dynamics NAV 7 Programming Cookbook

Microsoft Dynamics NAV 7 Programming Cookbook: Learn to customize, integrate and administer NAV 7 using practical, hands-on recipes , Second Edition

eBook
€24.99 €36.99
Paperback
€45.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Microsoft Dynamics NAV 7 Programming Cookbook

Chapter 1. String, Dates, and Other Data Types

In this chapter, we will cover the following recipes:

  • Retrieving the system date and time

  • Retrieving the work date

  • Determining the day, month, and year from a given date

  • Using the date formula to calculate dates

  • Converting a value to a formatted string

  • Creating an array

  • Creating an option variable

  • Converting a string to another data type

  • Manipulating string contents

Introduction


Data types are the base component in C/AL (Client/server Application Language) programming. Most of the data types are equivalent to the data types used in other programming language. Boolean, integer, decimal, dates, and strings are the most used data types in C/AL programming.

As developers, our job is to build a business tool that will manipulate the data input by users and make sure that data stored in tables is meaningful. Most of this data will be of the decimal, string, and date data types. NAV is, after all, a financial system at heart. At its most basic level, it cares about three things: "How much money?" (decimal), "What was it used for?" (string), and "When was it used?" (date).

The recipes in this chapter are very basic, but they will help you to understand the basics of C/AL coding. All recipes are accompanied by actual C/AL code from NAV objects.

Retrieving the system date and time


Most times, we need to capture the system date and time of users' actions on NAV. This recipe will illustrate how to get the system date and time.

How to do it...

  1. Let's create a new codeunit from Object Designer.

  2. Now add the following code into the OnRun trigger of the codeunit:

    MESSAGE('Todays Date: %1\Current Time: %2', TODAY, TIME);
  3. To complete the development of the codeunit, save and close it.

  4. On executing the codeunit, you should see a window similar to the one in the following screenshot:

How it works...

The TODAY keyword returns the date and the TIME keyword returns the time from the NAV Server system.

In the case of the older version of the NAV client—specifically the classic client—the date and time are taken from the client computer, which allows users to manipulate the system clock as per their personal requirement.

You can also retrieve the system date and time all at once using the CURRENTDATETIME function. The date and time can be extracted using the DT2DATE and DT2TIME functions respectively.

Note

For a complete list of date functions, run a search for the date function and the time function in the Developer and IT Pro Help option in the Help menu of Microsoft NAV Development Environment

There's more...

The change log is a base NAV module that allows you to track changes to specific fields in tables. The following code can be found in the 423, Change Log Management codeunit in the InsertLogEntry() method:

ChangeLogEntry.INIT;
ChangeLogEntry."Date and Time" := CURRENTDATETIME;
ChangeLogEntry.Time := DT2TIME(ChangeLogEntry."Date and Time");

Here, instead of using the WORKDATE function, we use the CURRENTDATETIME function and then extract the time using the DT2TIME function. The system designers can just do the following setup:

ChangeLogEntry.Date := TODAY;
ChangeLogEntry.Time := TIME;

The advantage of using CURRENTDATETIME over TODAY and TIME is minimal. CURRENTDATETIME makes one request to the system while the second method makes two. It is possible that another operation or thread on the client machine could take over between retrieving the date and time from the computer; however, this is very unlikely. The operations could also take place right before and after midnight, generating some very strange data. The requirements for your modification will determine which method is best suited, but generally CURRENTDATETIME is the correct method to use.

See also

  • Retrieving the work date

  • Determining the day, month, and year from a given date

  • Converting a value to a formatted string

Retrieving the work date


To perform tasks such as completing transactions for a date that is not the current date, you may have to temporarily change the work date. This recipe will show you how to determine what that actual work date is as well as when and where you should use it.

Getting ready

  1. Navigate to Application Menu | Set Work Date or select the date in the status bar at the bottom of Microsoft Dynamics NAV.

  2. Input the work date in the Work Date field or select it from the calendar.

How to do it...

  1. Let's get started by creating a new codeunit from Object Designer.

  2. Then add the following code into the OnRun trigger of the codeunit:

    MESSAGE('Work Date: %1\Todays Date: %2\Current Time: %3',WORKDATE, TODAY, TIME);
  3. To complete the task, save and close the codeunit.

  4. On executing the codeunit, you should see a window similar to the following screenshot:

How it works...

To understand WORKDATE, we have used two more keywords in this recipe. The work date is a date internal to the NAV system. This date is returned using the WORKDATE keyword. It can be changed at any time by the user. The next date is TODAY; it's a keyword to retrieve the present date that provides the date from the system. In the end, we used the TIME keyword, which provides current time information from the system clock.

Note

It is important to understand the difference between the NAV work date and the computer system date; they should be used in specific circumstances. When performing general work in the system, you should almost always use the WORKDATE keyword. In cases where you need to log information and the exact date or time when an action occurred, you should use TODAY or TIME, or CURRENTDATETIME.

There's more...

The following code can be found in the 38, Purchase Header table, in the UpdateCurrencyFactor() method:

IF "Posting Date" <> 0D THEN
CurrencyDate := "Posting Date"
ELSE
CurrencyDate := WORKDATE;

Looking at this code snippet, we can see that if a user has not provided any specific posting date, the system will assign the value WORKDATE as the default value for the posting date.

See also

  • Determining the day, month, and year from a given date

  • Converting a value to a formatted string

  • The Checking for conditions using an IF statement recipe in Chapter 2, General Development

  • The Using the CASE statement to test multiple conditions recipe in Chapter 2, General Development

Determining the day, month, and year from a given date


Sometimes it is necessary to retrieve only part of a date. NAV has built-in functions to do just that. We will show you how to use them in this recipe.

How to do it...

  1. Let's create a new codeunit from Object Designer.

  2. Then add the following global variables by navigating to View | C/AL Globals (Alt + V + B):

    Name

    Type

    Day

    Integer

    Month

    Integer

    Year

    Integer

  3. Write the following code into the OnRun trigger of the codeunit:

    Day := DATE2DMY(TODAY, 1);
    Month := DATE2DMY(TODAY, 2);
    Year := DATE2DMY(TODAY, 3);
    MESSAGE('Day: %1\Month: %2\Year: %3', Day, Month, Year);
  4. To complete the task, save and close the codeunit.

  5. On executing the codeunit, you should see a window similar to the following screenshot:

How it works...

The Date2DMY function is a basic feature of NAV. The first parameter is a date variable. This parameter can be retrieved from the system using TODAY or WORKDATE. Additionally, a hardcoded date such as 01312010D or a field from a table, such as Sales Header or Order Date can be used as a first parameter. The second parameter is an integer that tells the function which part of the date to return. This number can be 1, 2, or 3, and corresponds to the day, month, and year (DMY) respectively.

Note

NAV has a similar function called Date2DWY. It will return the week of the year instead of the month if 2 is passed as the second parameter.

There's more...

The following code can be found in the 485, Business Chart Buffer table in the UpdateCurrencyFactor() method of the GetNumberOfYears() function:

EXIT(DATE2DMY(ToDate,3) - DATE2DMY(FromDate,3));

This function has two parameters of type date and it returns the value in integer. The basic usage of this function is to calculate the duration between two dates in terms of years.

See also

  • Retrieving the system date and time

  • Retrieving the work date

  • The Repeating code using a loop recipe in Chapter 2, General Development

  • The Checking for conditions using an IF statement recipe in Chapter 2, General Development

Using the date formula to calculate dates


The date formula allows us to determine a new date based on a reference date. This recipe will show you how to use the built-in CALCDATE NAV function for date calculations.

How to do it...

  1. Let's start by creating a new codeunit from Object Designer.

  2. Add the following global variable by navigating to View | C/AL Globals (Alt + V + B):

    Name

    Type

    CalculatedDate

    Date

  3. Write the following code into the OnRun trigger of the codeunit:

    CalculatedDate := CALCDATE('CM+1D', 010110D);
    MESSAGE('Calculated Date: %1', CalculatedDate);
  4. Now save and close the codeunit.

  5. On executing the codeunit, you should see a window similar to the following screenshot:

How it works...

The CALCDATE() function takes in two parameters: a calculation formula and a starting date. The calculation formula is a string that tells the function how to calculate the new date. The second parameter tells the function which date it should start with. A new date is returned by this function, so the value must be assigned to a variable.

The following units can be used in the calculation formula:

Unit

Description

D

Day

WD

Weekday

W

Week

M

Month

Q

Quarter

Y

Year

These units may be different depending on what language version NAV is running under.

You have two options to place the number before the unit. It can either be a standard number ranging between 1 and 9 or the letter C, which stands for current. These units can be added and subtracted to determine a new date based on any starting date.

Calculation formulas can become very complex. The best way to fully understand them is to write your own formulas to see the results. Start out with basic formulas such as 1M + 2W - 1D and move on to more complex ones, such as –CY + 2Q - 1W.

There's more...

The following code is part of the CalcNumberOfPeriods() function of the 485, Business Chart Buffer table:

"Period Length"::Week:
  NumberOfPeriods := (CALCDATE('<-CW>',ToDate)- CALCDATE('<CW>',FromDate)) DIV 7;

The preceding code snippet will return the difference between two dates in terms of weeks. <-CW> will provide a week start date of ToDate whereas <CW> will provide a week end day of FromDate. The difference between the calculated days will be divided by 7 to get the total number of weeks.

For more details on CALCDATE, visit the following URL:

http://msdn.microsoft.com/en-us/library/dd301368(v=nav.70).aspx

See also

  • Retrieving the system date and time

  • Retrieving the work date

  • Determining the day, month, and year from a given date

  • The Checking for conditions using an IF statement recipe in Chapter 2, General Development

Converting a value to a formatted string


There will be many occasions when you will need to display information in a certain way or multiple variable types on a single line. The FORMAT function will help you change almost any data type into a string that can be manipulated in any way you see fit.

How to do it...

  1. Let's get started by creating a new codeunit from Object Designer.

  2. Then add the following global variable:

    Name

    Type

    Length

    FormattedDate

    Text

    30

  3. Now write the following code into the OnRun trigger of the codeunit:

    FormattedDate := FORMAT(TODAY, 0, '<Month Text> <Day,2>,<Year4>');
    MESSAGE('Today is %1', FormattedDate);
  4. To complete the task, save and close the codeunit.

  5. On executing the codeunit, you should see a window similar to the following screenshot:

How it works...

The FORMAT function takes one to three parameters. The first parameter is required and can be of almost any type: date, time, integer, decimal, and so on. This parameter is returned as a string.

The second parameter is the length of the string to be returned. The default, zero, means that the entire string will be returned, a positive number tells the function to return a string of exactly that length, and a negative number returns a string not larger than that length.

There are two options for the third, and final, parameter. One is a number, representing a predefined format you want to use for the string, and the other is a literal string. In the example, we used the actual format string. The text contained in the angular brackets (< >) will be parsed and replaced with the data in the first parameter.

Note

There are many predefined formats for dates. Run a search for Format Property in the Developer and IT Pro Help option in the Help menu of Microsoft NAV Development Environment or visit the following URL:

http://msdn.microsoft.com/en-us/library/dd301059(v=nav.70).aspx

There's more...

The following code can be found on the OnValidate() trigger of the Starting Date field from the 50, Accounting Period table:

Name := FORMAT("Starting Date",0,Text000);

In the preceding code, Text000 is a text constant and carries the <Month Text> value. This code will return month of "Starting Date" in text format.

See also

  • Retrieving the system date and time

  • Retrieving the work date

  • Determining the day, month, and year from a given date

  • Converting a string to another data type

  • The Checking for conditions using an IF statement recipe in Chapter 2, General Development

  • The Advanced filtering recipe in Chapter 3, Working with Tables, Records, and Queries

  • The Retrieving data using the FIND and GET statements recipe in Chapter 3, Working with Tables, Records, and Queries

Creating an array


Creating multiple variables to store related information can be time consuming. It leads to more code and more work. Using an array to store related and similar types of information can speed up development and lead to much more manageable code. This recipe will show you how to create and access array elements.

How to do it...

  1. Let's create a new codeunit from Object Designer.

  2. Add the following global variables by navigating to View | C/AL Globals (Alt + V + B):

    Name

    Type

    i

    Integer

    IntArray

    Integer

  3. Now, with the cursor on the IntArray variable, navigate to View | Properties (Shift + F4).

  4. In the Property window, set the following property:

    Property

    Value

    Dimensions

    10

  5. Write the following code into the OnRun trigger of the codeunit:

    FOR i := 1 TO ARRAYLEN(IntArray) DO BEGIN
      IntArray[i] := i;
      MESSAGE('IntArray[%1] = %2', i, IntArray[i]);
    END;
  6. To complete the task, save and close the codeunit.

  7. On executing the codeunit, you should see a window similar to the following screenshot:

How it works...

An array is a single variable that holds multiple values. The values are accessed using an integer index. The index is passed within square brackets ([ ]).

Note

NAV provides several functions to work with arrays. For instance, ARRAYLEN returns the number of dimensions of the array and COPYARRAY will copy all of the values from one array into a new array variable. You can find a complete list of the array functions in the Developer and IT Pro Help option in the Help menu of Microsoft NAV Development Environment.

There's more...

Open the 365, Format Address codeunit. Notice that the first function, FormatAddr, has a parameter that is an array. This is the basic function that all of the address formats use. It is rather long, so we will discuss only a few parts of it here.

This first section determines how the address should be presented based on the country of the user. Variables are initialized depending on which line of the address should carry certain information. These variables will be the indexes of our array.

CASE Country."Contact Address Format" OF
  Country."Contact Address Format"::First:
    BEGIN
      NameLineNo := 2;
      Name2LineNo := 3;
      ContLineNo := 1;
      AddrLineNo := 4;
      Addr2LineNo := 5;
      PostCodeCityLineNo := 6;
      CountyLineNo := 7;
      CountryLineNo := 8;
    END;

Then we will fill in the array values in the following manner:

AddrArray[NameLineNo] := Name;
AddrArray[Name2LineNo] := Name2;
AddrArray[AddrLineNo] := Addr;
AddrArray[Addr2LineNo] := Addr2;

Scroll down and take a look at all of the other functions. You'll see that they all take in an array as the first parameter. It is always a text array of length 90 with eight dimensions. These are the functions you will call when you want to format an address. To use this codeunit correctly, we will need to create an empty array with the specifications listed before and pass it to the correct function. Our array will be populated with the appropriately formatted address data.

See also

  • Manipulating string contents

  • The Using the CASE statement to test multiple conditions recipe in Chapter 2, General Development

Creating an option variable


If you need to force the user to select a value from a predefined list, an option is the way to go. This recipe explains how to create an Option variable and access each of its values.

How to do it...

  1. Let's create a new codeunit from Object Designer.

  2. Then add the following global variable:

    Name

    Type

    ColorOption

    Option

  3. With the cursor on the ColorOption variable, navigate to View | Properties or (Shift + F4).

  4. In the Property window, set the following property:

    Property

    Value

    OptionString

    None,Red,Green,Blue

  5. Now write the following code into the OnRun trigger of the codeunit:

    ColorOption := ColorOption::Green;
    CASE ColorOption OF
      ColorOption::None: MESSAGE('No Color Selected');
      ColorOption::Red: MESSAGE('Red');
      ColorOption::Green: MESSAGE('Green');
      ColorOption::Blue: MESSAGE('Blue');
    END;

  6. Save and close the codeunit.

  7. On executing the codeunit, you should see a window similar to the one shown in the following screenshot:

How it works...

An Option is a field or variable that stores one value from a selectable list. In a form, this list will appear as a dropdown from which the user can select a value. The list of options is stored as a comma-separated string in the OptionString property. If we query such stored values from a SQL database, we will receive an integer value representing each option. In our current example, the integer value has been mapped with options, where None = 0, Red = 1, Green = 2, and Blue = 3.

These values are accessed using the variable_name::option_name syntax. The first line of the example assigns one of the possible values (Green) to the variable. Then we use a CASE statement to determine which of the values were selected.

Note

There are many predefined formats for dates. Run a search for Format Property in the Developer and IT Pro Help option in the Help menu of Microsoft NAV Development Environment.

There's more...

The Option fields are prevalent throughout the NAV system, but most commonly on documents. In NAV, many documents share the same table. For example, sales quotes, orders, invoices, and return orders are all based on the Sales Header table. In order to distinguish between the types, there is an Option field called Document Type. Design the 36, Sales Header table to see the available options for this field.

Now design the 80, Sales-Post codeunit. Examine the OnRun trigger. At the start of the function, you will see the following code:

  CASE "Document Type" OF
  "Document Type"::Order:
    Receive := FALSE;
  "Document Type"::Invoice:
    BEGIN
      Ship := TRUE;
      Invoice := TRUE;
      Receive := FALSE;
    END;
  "Document Type"::"Return Order":
    Ship := FALSE;
  "Document Type"::"Credit Memo":
    BEGIN
      Ship := FALSE;
      Invoice := TRUE;
      Receive := TRUE;
    END;
  END;

This is a common example of how options are used in NAV. You can scroll through the codeunit to find more examples.

See also

  • The Using the CASE statement to test multiple conditions recipe in Chapter 2, General Development

Converting a string to another data type


Sometimes, a string representation isn't enough. In order to perform certain actions, you need your data to be in a certain format. For example, we are reading data from a text file, so our entire data is simple text, which needs to be converted into an appropriate data type to use it in NAV. This recipe will show you how to change that data into a format that you can use.

How to do it...

  1. Let's start by creating a new codeunit from Object Designer.

  2. Now add the following global variables:

    Name

    Type

    Length

    DateText

    Text

    30

    DateValue

    Date

     
  3. Write the following code into the OnRun trigger of the codeunit:

    DateText := '01/10/2012';
    EVALUATE(DateValue, DateText);
    MESSAGE('Microsoft Dynamics NAV 2013 launch date is %1', DateValue);
  4. To complete the development, save and close the codeunit.

  5. On executing the codeunit, you should see a window similar to the one shown in the following screenshot:

How it works...

The EVALUATE() function takes in two parameters. The first is a variable of the type that we want our value to be converted into. This could be date, time, Boolean, integer, or any other simple data type. This parameter is passed by reference, meaning that the result of the function is stored in that variable. There is no need to do a manual assignment to get a return value.

The second parameter is the string that you need to convert. This text is usually stored in a field or variable, but can also be hardcoded.

Note

EVALUATE() returns a Boolean value when executed. If the conversion is successful, it returns TRUE or 1; otherwise, it returns FALSE or 0. If the function returns FALSE, an error will be generated.

There's more...

The EVALUATE() function is widely used in NAV C/AL code. The following code snippet is taken from the CheckCreditCardData() function of the 825, Do Payment Mgt codeunit:

EVALUATE (IntValue1,FORMAT(TODAY,0,'<Year>'));
EVALUATE (IntValue2,COPYSTR(DOPaymentCreditCard."Expiry Date",3,2));
IF IntValue1 > IntValue2 THEN
  ERROR (Text006, CreditCardNo, DOPaymentCreditCard.FIELDCAPTION ("No."));

Before completing a transaction, the credit card's validity period needs to be checked. The preceding code extracts the year from the current date provided by the TODAY function and the expiry date of the credit card. Both the values are evaluated using the relational operator. If the card has expired, the system will execute a predefined error message in text constant Text006.

See also

  • Converting a value to a formatted string

  • The Checking for conditions using an IF statement recipe in Chapter 2, General Development

  • The Passing parameters by reference recipe in Chapter 2, General Development

Manipulating string contents


It can be very useful to parse a string and retrieve certain values. This recipe will show you how to examine the contents of a string and manipulate that data.

How to do it...

  1. Let's create a new codeunit from Object Designer.

  2. Add a function called RemoveNonNumeric. It should return a text variable called NewString.

  3. Add the following parameters for the same function:

    Name

    Type

    Length

    String

    Text

    30

  4. Now add the following global variables:

    Name

    Type

    Length

    OldPhoneNumber

    Text

    30

    NewPhoneNumber

    Text

    30

    I

    Integer

     
  5. Write the following code to the RemoveNonNumeric function:

    FOR i := 1 TO STRLEN(String) DO BEGIN
    IF String[i] IN ['0', '1', '2', '3', '4', '5', '6', '7','8','9'] THEN
      NewString := NewString + FORMAT(String[i]);
    END;
  6. Write the following code into the OnRun trigger of the codeunit:

    OldPhoneNumber := '(230) 299-876';
    NewPhoneNumber := RemoveNonNumeric(OldPhoneNumber);
    MESSAGE('Old Phone Number: %1\New Phone Number: %2', OldPhoneNumber, NewPhoneNumber);
  7. To complete the task, save and close the codeunit.

  8. On executing the codeunit, you should see a window similar to the one shown in the following screenshot:

How it works...

A string is actually an array of characters. The same array syntax will be used to access the individual characters of the string.

We start with a FOR loop that begins at the first character, with index 1, and goes on until we reach the end of our string. This is determined using the STRLEN() function, which stands for string length. As the first index is 1, the last index will be N or the number of characters in the string.

Next, we access the character at that index using square brackets. If the character is a number, meaning we want to keep it because it is a numeric value, we add it to our resulting string.

Note

NAV comes with plenty of built-in string manipulation functions to remove characters, return substrings, find characters within strings, and many more. A search in the Developer and IT Pro Help option of the Help menu of Microsoft NAV Development Environment for string functions will give you a complete list.

There's more...

The CheckIBAN function of the 79, Company Information table is a simple example of string manipulation to validate IBAN (International Bank Account Number). IBAN is internationally agreed on and adopted. It consists of up to 34 alphanumeric characters: the first two letters are the country code, then two check digits, and finally a country-specific Basic Bank Account Number. The same is validated by manipulating the input string using various functions. The following code gives you an example for the same:

IF IBANCode = '' THEN
  EXIT;
IBANCode := DELCHR(IBANCode);
Modulus97 := 97;
IF (STRLEN(IBANCode) <= 5) OR (STRLEN(IBANCode) > 34) THEN
  IBANError;
ConvertIBAN(IBANCode);
WHILE STRLEN(IBANCode) > 6 DO
  IBANCode := CalcModulus(COPYSTR(IBANCode,1,6),Modulus97) + COPYSTR(IBANCode,7);
EVALUATE(I,IBANCode);
IF (I MOD Modulus97) <> 1 THEN
  IBANError;

There are a few more functions used to validate the string; such as ConvertIBAN, CalcModulus, and ConvertLetter. These functions can give you a basic idea to write your own code.

For more complex examples, please follow the DecomposeRowID() function in the 6500, Item Tracking Management codeunit. The code evaluates the value stored in the Source RowId field of the 6508, Value Entry Relation table.

See also

  • Converting a value to a formatted string

  • Creating an array

  • The Repeating code using a loop recipe in Chapter 2, General Development

  • The Checking for conditions using an IF statement recipe in Chapter 2, General Development

Left arrow icon Right arrow icon

Key benefits

  • Integrate NAV with external applications, using the C/AL or SQL server
  • Develop .NET code to extend NAV programming possibilities
  • Administer the Microsoft NAV 7 server and database

Description

Microsoft Dynamics NAV 7 is a business management solution that helps simplify and streamline highly specialized business processes. Learning NAV programing in NAV 7 gives you the full inside view of an ERP system. Microsoft Dynamics NAV 7 Programming Cookbook covers topics that span a wide range of areas such as integrating the NAV system with other software applications including Microsoft Office, and creating reports to present information from multiple areas of the system,. We will not only learn the essentials of NAV programming, you will also be exposed to the technologies that surround NAV including.NET programming, SQL Server and NAV system administration. Microsoft Dynamics NAV 7 Programming Cookbook is written in a direct, to-the-point style to help you get what you need and continue working in NAV. The first half of the cookbook will help programmers using NAV for the first time, by walking them through the building blocks of writing code and creating objects such as tables, pages, and reports. The second half focuses on using the technologies surrounding NAV to build better solutions. You will learn how to write .NET code that works with the NAV system and how to integrate the system with other software applications such as Microsoft Office or even custom programs. You will learn everything you need to know for developing all types of NAV CSIDE objects, as well as how to integrate and maintain a NAV system.

Who is this book for?

If you are a junior / entry-level NAV developer then the first half of the book is designed primarily for you. You may or may not have any experience programming. It focuses on the basics of NAV programming. If you are a mid-level NAV developer, you will find these chapters explain how to think outside of the NAV box when building solutions. There are also recipes that senior developers will find useful.

What you will learn

  • Build tables and perform complex actions on their data
  • Design different types of pages to display and interact with business data
  • Create reports to present information from multiple areas of the system
  • Build solutions that work with the entire Microsoft Office suite of products
  • Learn to work with SQL Server and execute basic queries against the NAV database
  • Diagnose and resolve code problems
Estimated delivery fee Deliver to Luxembourg

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 24, 2013
Length: 312 pages
Edition : 2nd
Language : English
ISBN-13 : 9781849689106
Vendor :
Microsoft
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Luxembourg

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Sep 24, 2013
Length: 312 pages
Edition : 2nd
Language : English
ISBN-13 : 9781849689106
Vendor :
Microsoft
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 137.97
Getting Started with Dynamics NAV 2013 Application Development
€37.99
Programming Microsoft Dynamics NAV 2013
€53.99
Microsoft Dynamics NAV 7 Programming Cookbook
€45.99
Total 137.97 Stars icon

Table of Contents

12 Chapters
String, Dates, and Other Data Types Chevron down icon Chevron up icon
General Development Chevron down icon Chevron up icon
Working with Tables, Records, and Queries Chevron down icon Chevron up icon
Designing Pages Chevron down icon Chevron up icon
Report Design Chevron down icon Chevron up icon
Diagnosing Code Problems Chevron down icon Chevron up icon
Roles and Security Chevron down icon Chevron up icon
Leveraging Microsoft Office Chevron down icon Chevron up icon
OS Interaction Chevron down icon Chevron up icon
Integration Chevron down icon Chevron up icon
Working with the SQL Server Chevron down icon Chevron up icon
NAV Server Administration Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.1
(8 Ratings)
5 star 50%
4 star 37.5%
3 star 0%
2 star 0%
1 star 12.5%
Filter icon Filter
Top Reviews

Filter reviews by




James Liang Nov 13, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book very useful for a new programer that they want to use C/AL to create/Modify Navision.Author use "How to do it" example then use "How It works" to explain how to use this functionand "There's more.." to show more example in Navision.
Amazon Verified review Amazon
Matthias Günther Feb 14, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
GUT
Amazon Verified review Amazon
Jón Heiðar Pálsson Jan 02, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book - easy to use and good examples.This book has helped programmers in Dynamics NAV. Keep on the good work.Jón Heiðar
Amazon Verified review Amazon
Baragiola Diego Oct 30, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have been working with NAV during the last 10 years and I thought to know everything about NAV development, but I was wrong. I find this guide suitable for beginners as well as old consultants like me. The paths explained are very clear, with useful "How to do it..." sections. A must, to keep your knowledge up-to-date.
Amazon Verified review Amazon
Georgios T. Nov 05, 2013
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This is a great Book, helpful not only to programmers but also to any functional Consultant. It is analytical and very clear.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela