Sunday, November 29, 2009

Shifted to new Blog

Dear Reader,

Due to very important reasons, this blog address is shifted to the new blog http://midynav.blogspot.com/.

Please look into the new blog from now onwards.

Thanks,
Admin.

Saturday, November 28, 2009

How to block New, Edit and View actions in the ListPage

In Microsoft Dynamics NAV RT Client, pages has default actions like New, Edit, View and etc…imageIn the ListPage, New action is promoted and shown in the New Promoted Category. This action is not promoted in the card part. 

image According to my requirement, I do not want New promoted action in the listpage. This can be achived by customizing the Actions like the following:

image image

But this process should need to be done in every client. The same requirement can be achieved by modifying the TIF information.

For Customer List Example: Remove the CardFormID field value in the TIF information for the Customer List and transform the page to form..

image image image

Limitations: Double clicking the Customer List will not open the Customer Card (Standard Functionality). Work around is to create a new action to open the Card and promote this action.

image

SAVERECORD and UPDATE

In Microsoft Dynamics NAV, CurrForm.SAVERECORD or CurrPage.SAVERECORD is used to save the current record shown on the form/page. CurrForm.UPDATE(True or False) or CurrPage.UPDATE(True or False) is used to save the current record based on the parameter and updates the controls in the form/page.

Using the two functions together in the form/page does not give any error normally but error will be displayed in pages if the following code is called before inserting the record.

CurrPage.SAVERECORD();//Which save the record.
CurrPage.UPDATE;//Which updates the controls.

For Example: Add the above lines of code in the Type – OnValidate() in the “46 Sales Order Subform” page and try to insert the sales line.

image This is because above set of code is trying to insert the record in two places one is using SAVERECORD and second is UPDATE (even though Parameter is FALSE).

Friday, November 27, 2009

How to read BLOB data and export into a File

In Microsoft Dynamics NAV tables, we can create BLOB fields to store large amount of data. It is not possible to read the data in the BLOB fields directly.

The following steps shows the procedure to read the BLOB data. In this example, I have taken “User Metadata” table to read the data in the “Page Metadate Delta” field.

1) Create a codeunit with the below variables.

Name DataType Subtype Length
UserMetadata Record User Metadata  
Data InStream    
Line Text   1024
Pos Integer    
File1 File    

2) Add the following code to the codeunit.

image 3) Save and Run the codeunit. Text file will be created in the given path with the data in the BLOB field.

Thanks,

Veerendra CH.

Thursday, November 26, 2009

Understanding the Difference Between GP, NAV, SL and AX

Here is the nice post from Houston Neal on “Understanding the Difference Between GP, NAV, SL and AX”.

Please click the link to read this post.

Monday, November 9, 2009

Object Subtype field in the AllObjWithCaption table

In Microsoft Dynamics NAV, AllObjWithCaption table is one of the virtual table from the older versions.

This AllObjWithCaption virtual table holds all the objects details like Type, ID, Name and Caption.

One new field Object Subtype is added to this table in NAV 2009.

image

This field is used to store subtype of two object types. 1) Codeunits 2) Pages

Codeunits has three Subtypes.

1) Normal: These are normal coduenits.

2) Test: Testing Codeunit

3) TestRunner: Test runner codeunit, used to run the Test Codeunits.

Pages has different subtypes like Card, List, Worksheet, Document, etc…

Saturday, October 24, 2009

How Run button in Object Designer opens the page in the RTC

In the NAV 2009 SP1, it is possible to run the Page from the Object Designer.

image In the Object Designer, Run button will open the related page in Role Tailored Client. I think this is achieved using the HYPERLINK function in Navision.

HYPERLINK function passes a URL as an argument to an Internet browser.

By adding the following code in OnPush Tirgger of any button will open the related page in Role Tailored Client.

HYPERLINK('DynamicsNAV:////runpage?page=' + FORMAT(ID));

Here ID valud should be Page ID.

The above code can also be applied to open the reports in Role Tailored Client.

HYPERLINK('DynamicsNAV:////runreport?report=' + FORMAT(ID));

The above line of code can be added to any form/page to open the pages/reports dynamically.