Friday, January 20, 2012

ROUND Function

ROUND function in NAV, rounds the value of a numeric variable.

For Example: ROUND(1234.56789, 0.001, ‘>’) returns 1,234.568

NewNumber := ROUND(Number [, Precision] [, Direction])

You can give your own precision in this function.


For Example: ROUND(1234.56789,0.50,’=’) returns 1234.50 i.e. nearest 50


ROUND(1234.4956789,0.25,'<') returns 1,234.25

Thursday, March 3, 2011

Series of Interview Video’s

Software Advise, which is a research company on mrp software published a series of videos with the interview from Microsoft’s Director of ERP Marketing, Guy Weismantel. Click this link to view the videos.

Wednesday, February 16, 2011

How does Dynamics NAV validates the Credit Card number for Online Payments

Dynamics NAV 2009 R2 has a new feature called “Online Services” and using this functionality you can accept and process credit card payments in Microsoft Dynamics NAV.This online credit card payment feature automates authorizing credit card amounts at the time of the order and processing the actual charge when the order is shipped and invoiced.

In order to use this online payment services, you need to setup payment services, customer payment methods and credit cards for the customers. While setting up the Number field in the Credit Card page (Customer Card—>Customers—>Credit Cards), Dynamics NAV automatically validates value for the correct credit card number and gives the error message for invalid credit card numbers.

image

This validation is not a real credit card number validation from the service providers but uses the algorithm called “Modulus10”. This algorithm was designed to protect against accidental errors, not malicious attacks. Most credit cards and many government identification numbers use the algorithm as a simple method of distinguishing valid numbers from collections of random digits. You can find the related C/AL code in the codeunit 827 “DO Payment Card Validation” function “IsModulus10”.

Friday, December 24, 2010

Locking and Unlocking Objects– Auto-Lock on Design

In Microsoft Dynamics NAV 2009 R2, you can lock an object in Object Designer using Lock option. Along with Lock we have other options like Unlock and Force Unlock.

Along with these features you can automatically lock an object while opening the object in design mode.

This option is available in the Tools->Options->Auto-Lock on Design.

image

Even though you can lock objects, it is still possible for developers to have concurrency issues, as shown in the following examples.

  • A developer opens an object in the designer but does not lock it. The developer makes several changes to the object and saves the changes periodically. At the same time, a second developer locks the object, and the first developer cannot save design changes to the object. The first developer gets an error message that the object is locked by the second developer.
  • A developer locks an object. A second developer opens the locked object in read-only mode, and then the first developer unlocks the object. The second developer still cannot save design changes to the object even though the object is now unlocked because it is open in read-only mode.

System Indicator–Dynamics NAV 2009 R2

Till now all NAV users including developers or end users felt little difficult to identify the different instances of NAV. Now we have a solution called system indicator in NAV 2009 R2 release to differentiate different instances like production environment and test environment.

Once you setup the system indicator in the company information, you can see the indicator text in the top right side of each page in the Role Tailored Client…Cool…Winking smile

image

image

NOTE: Refer GetSystemIndicator function in the Codeunit 1 ApplicationManagement.

Thursday, December 16, 2010

What’s New in Microsoft Dynamics NAV 2009 R2

MSDN is updated with the latest help related to NAV 2009 R2 Application updates and Developer updates.

Please click the link and get updated with the latest stuff.

Monday, December 13, 2010

Book Review–Microsoft Dynamics NAV 2009 Programming Cookbook

Intended Audience:

This book seems to more appropriate for people who already have experience with Dynamics NAV and may want to review or have a quick overview of the basics.

I believe that a person with some programming background can also use this as a quick jump start to be able to be able to work on Dynamics NAV.

Content/ Information:

The content of the book is appropriate as per the title. The author has given appropriate technical information to convince the reader. By appropriate information I mean to say that the only specific (more frequently used) information is provided with reference to standard Dynamics NAV coding (wherever necessary).

The sections “How it works” and “There is more”, are really helpful as they are short and to the point.

The author’s style of writing is more informal, without compromising the quality. I really appreciate this style, because I believe the intended audience of this book would rather like to quickly review or update themselves with the content rather than spend time on formal and lengthy notations.

Overall the style completely suits the intended audience.

How did the book affect me?

I really liked the book from Chapter 6 onwards. Because this book has touched the areas in Dynamics NAV which a developer would like to precisely go through. The topics covered under Chapter 6 to Chapter 12 are really interactive and at the same time some parts of it can be used like tips and tricks.

Usually these topics are not covered together and have to be search for and more over the explanations are too lengthy. I believe that these topics are very useful and can be quickly reviewed whenever required with less complexity.

How well the book has achieved its goal?

The book achieves its goal, to be a “cookbook” ! It is precise and to the point. So no complaints, but I would like to place some of my concerns especially in earlier chapters:

  • I would have liked if more functions and data types were covered in Chapter 1, as many a times it mentions us to refer to C/SIDE reference guide for other/ similar kind of functions/data types.
  • The book gives appropriate examples, but forgets to mention the syntax. Nothing major but I think it would help people (especially new to Dynamics NAV) more.

Overall the books do achieves its goal. Here is a quick link to this book.

Wednesday, December 8, 2010

Book Review - Microsoft Dynamics NAV Administration

This is a helpful book for the beginners to get good idea on the following concepts:
                Installing Dynamics NAV and its components.
                Securing Dynamics NAV applications.
                Backup and Restore options.
                Performance Tuning.
                Reporting Dynamics NAV.
But the major chapters explained here are more or less available in different formats like MSDN and other Microsoft standard materials.
It would be good if the book covers more on Application Virtualization.
Overall I see this book as a very good guide to learn install, configure, deploy and administer Dynamics NAV.

Monday, November 22, 2010

Why manually renaming a record takes little time?

In Dynamics NAV, if you try to modify the primary key field values it will take little time to change the value and also shows the window processing different tables.

When you try to change the primary key field value, internally it will check for the fields in all the tables which has the table relation to the primary key. That means system will check for the foreign keys related to the primary key and change the field value to the new value.

Pointing upLet’s say you have tables like sales header & sales line and if you want to reflect the primary key changes in the sales header to sales line, provide the table relations in the sales line.

rename

Wednesday, October 20, 2010

TEMPORARYPATH and APPLICATIONPATH Functions

TEMPORARYPATH: This function returns the path to the directory where the temporary file for Microsoft Dynamics NAV is stored.

This function returns the following path in the classic client:image

This function returns the following path In the RT client: image

APPLICATIONPATH:  This function returns the path to the directory where the executable file for Microsoft Dynamics NAV is installed.

This function return the following path in the classic client:image

This function return the following path in the RT client:image

Tuesday, September 21, 2010

CurrFieldNo

We all know that CurrFieldNo contains the field number of the current field in the current form.

Today I noticed that even though it contains the field number, by the time of executing table trigger (like OnModify or OnDelete), it contains zero (not the last modified field number).

Monday, July 26, 2010

Book Review - Microsoft Dynamics NAV 2009 Application Design

First of all, congrats and thanks to Mark Brummel for writing a fantastic book and sharing his knowledge in very straight forward manner. When I got a copy of this book, I was very eager to read this and after started reading, my interest also increased from chapter to chapter. I learned new points and recalled my knowledge while reading this book. Instead of explaining basics of NAV, he explained the core points which are important for every NAV professional.

Especially I liked the following points in his book:
  • ‘Look, Learn and Love’ principle is good.
  • He not only explained the functionality and also the history of the functionality. For Example: Manufacturing.
  • How different functionalities are used in various vertical industries.
  • Application Life cycle chapter is useful.
In my opinion, it would be good if the book also covers the following points:
  • Section for keys and indexes.
  • Application Test Toolset.
  • More details about the MRP and MPS.
Mistakes:
  • In the Page 33, it is given as “Flow filters can have seven types” but it is flow fields.
Overall this book is suggestible for every NAV professional.
You can order this book from packtpub.

Friday, July 23, 2010

IndentationColumnName and IndentationControls properties

IndentationColumnName and IndentationControls are the page properties in the NAV 2009. These properties are used to indent the controls or columns.

Transformation Tool will automatically convert the following type of code in the form and adjust the above two properties in the page to show the data as indented.

For Example: Form 18, CurrForm.Name.UPDATEINDENT := Indentation * 220;

Now the major problem in the pages is, you cannot use these properties for the fields that are editable and has a table relation.

For example, you cannot indent Item No. or Location Code in the Item Journal page because these fields are editable and has a relation with another table. If you try to indent these fields, while entering the data into these fields, field value is automatically updated with the first value.

If you press “1” in the Item No. field, it will be automatically filled with the first value starting with 1 like “1000”.

Thursday, July 15, 2010

Microsoft Dynamics® Regional Partner Awards - 2010

Microsoft announced the Microsoft Dynamics® Regional Partner Awards – 2010.

Here is the link to the press release.

Saturday, July 10, 2010

Microsoft Dynamics Inner Circle and President Club Members

Microsoft announced the  Microsoft Dynamics Inner Circle and President Club Members for the FY10.

Here is the link to the list of winners and Congrats to them.

Friday, June 25, 2010

Dynamics NAV Testing Framework - Create Handler Functions

Microsoft Dynamics NAV 2009 SP1 includes the following features to help you test your application:

  • Test codeunits

  • Test runner codeunits

  • UI handlers

  • ASSERTERROR statement

Application Test Toolset provided by Microsoft includes the Test Runner and sample Test Codeunits.

To create automated tests, you must write code to handle all UI interactions so that the tests do not require user interaction when running. To do this, you create the following special handler functions:

  • MessageHandler: Handles MESSAGE statements.
  • ConfirmHandler: Handles CONFIRM statements.
  • StrMenuHandler: Handles STRMENU statements.
  • FormHandler: Handles specific forms or pages that are not run modally.
  • ModalFormHandler: Handles specific forms or pages that are run modally.
  • ReportHandler: Handles specific reports.

In the following post, I included sample UI Handler Functions which can be used while creating test codeunits.

Signature: MessageHandler <Function name>(<Msg> : Text[1024])

Sample Code:

    [MessageHandler]
    PROCEDURE MessageHandler@1100499002(Msg@1100499000 : Text[150]);
    VAR
      Text001@1100499001 : TextConst 'ENU=Sales Order posted sucessfully.';
    BEGIN
      IF Msg <> Text001 THEN
        ERROR('Unknown Message');
    END;

 

Signature: ConfirmHandler <Function name>(<Question> : Text[1024]; VAR <Reply> : Boolean)

Sample Code:

    [ConfirmHandler]
    PROCEDURE ConfirmDialogYes@1102601013(Question@1102601000 : Text[1024];VAR Reply@1102601001 : Boolean);
    VAR
      Text001@1100499001 : TextConst 'ENU=Do you want to post the Sales Order?';
    BEGIN
      IF Question <> Text001 THEN
        ERROR('Unknown Confirm Text; %1',Question);
      Reply := TRUE;
    END;

 

Signature: StrMenuHandler <Function name>(<Options : Test[1024]; VAR <Choice> : Integer; <Instruction> : Text[1024])

Sample Code:

    [StrMenuHandler]
    PROCEDURE StrMenuHandler@1100499000(Options@1100499000 : Text[100];VAR Choice@1100499001 : Integer;Instruction@1100499002 : Text[100]);
    VAR
      Text000@1100499003 : TextConst 'ENU=&Ship,&Invoice,Ship &and Invoice';
    BEGIN
      IF Options = Text000 THEN
        Choice := 1;
    END;

 

Signature: FormHandler <Function name>(VAR <form name> : Form <form id>)

Sample Code:

    [FormHandler]
    PROCEDURE FormHandler@1100499001(VAR FormName@1100499000 : Form 21);
    BEGIN
      FormName.ActivateFields
    END;

 

Signature: ModalFormHandler <Function name>(VAR <form name> : Form <form id>; VAR <Response> : Action)

Sample Code:

    [ModalFormHandler]
    PROCEDURE ModalFormHandler@1100499002(VAR FormName@1100499000 : Form 342;VAR ReplyAction@1100499001 : Action);
    BEGIN
      ReplyAction := ACTION::LookupOK;
    END;

NOTE: UI Handler functions should be specified in the main test function as below.

image

Wednesday, June 2, 2010

Shortcuts in NAV 2009 (Special for List Page)

In NAV 2009 SP1, we all know that Ctrl+Shift+V is to open the page in View Mode, Ctrl+Shift+E is to open the page in Edit Mode.

Along with the above two shortcuts, we also have Ctrl+Shift+L to open the list page in View Mode, Ctrl+Shift+K is to open the list page in Edit Mode.

image But the second shortcuts (Ctrl+Shift+L, Ctrl+Shift+K) won’t work for all list pages. My learning today is, second shortcuts are only applied to the list pages which does not have a card page attached to it.

For Example: Payment Terms page which has no card page linked will show Ctrl+Shift+L and Ctrl+Shift+K.

imageFor Example:  Item List page which has card page (30) linked will show Ctrl+Shift+V and Ctrl+Shift+E.

image

Tuesday, June 1, 2010

Dynamics NAV Job Graphs

Job Graphs website provided graphical analytical interpretation of different aspect of Dynamics NAV…

Refer the link to find the details…

Monday, May 24, 2010

How to insert records into NAV from Visual Studio

Below is a simple console application to create a customer record from the visual studio.

namespace ConsoleApplication1
{
    using Customer;
    class Program
    {
        static void Main(string[] args)
        {
            Customer_Service service = new Customer_Service();
            service.UseDefaultCredentials = true;
            Customer.Customer customer = new Customer.Customer() { No = "123491", Blocked = Blocked.Ship};
            service.Create(ref customer);
        }   
    }
}

This will insert customer record but Blocked field does not contains the correct value. This can be achieved by changing the line as below:

Customer.Customer customer = new Customer.Customer() { No = "123491", Blocked = Blocked.Ship, BlockedSpecified = true};

This is mostly required for all fields except the string type because I think web services request/responses are in xml and type conversions are required internally from string to other data type.