Monday, October 28, 2013

Download Dynamics NAV 2013 R2

How to access SQL object From Dynamics NAV 2009

Hi
Following example will show how to access a sql view from Dynamics NAV 2009
  • Create a SQL view
  • Create a Table in NAV field names as same as field names in sql view
  • go to the report properties and change "LinkedObject" to yes
  • save the Table . Table name should be as same as view name
  • run Table
Create View in sql

CREATE VIEW [CRONUS International Ltd_$SamView] AS
SELECT [No_],[Name]
FROM [Demo Database NAV (6-0)].[dbo].[CRONUS International Ltd_$Customer]

Create Table in NAV






save table and run it :)

Thanks
Marshal. J


Sunday, October 20, 2013

How Create linked Reports in NAV 2013/RTC

Hi all,
below example will show how to link a Report/Page to another report, lets assume customer summary report needs to be linked with customer trial balance, so that user clicks the amount field in customer summary report then customer detail trial balance should run automatically and show the balance

  • Create a report using Customer table as data item as like below

  • Go to View -> Layout
  • Design the report as like bvelow

  • Go to the properties of the [Balance] column -> Action -> URL
  •  paste below code at Select URL field , First one will run report without any filter
  • ="DynamicsNAV:////runReport?Report=104
  • ="DynamicsNAV:////runReport?Report=104&$filter=Customer.'No.'%20IS%20'"+Fields!CustomerNo.Value+"'"
  • Save and run the report from NAV above code will run report 104 when the user clicks the amount field of newly created report
  • Applicable for Dynamics NAV  2009 RTC Client/ NAV 2013


Thanks
Jerome Marshal. J






How to convert Duration to Integer Dynamics NAV

Hi All

Below example will convert the duration variable to integer, Normally in  Dynamics NAV duration data type will display the data as  like  "5 Days 7 Hours 35 Minutes 12 seconds". Even some times it will include Milli seconds too so how to convert this into integer to calculate the exact hours spent

Name               DataType    Subtype    Length
ProcessStart     DateTime       
ProcessEnd      DateTime
TimeDuration  BigInteger
TotalHours       Integer        


ProcessStart := CREATEDATETIME(010109D,072005T);
ProcessEnd := CREATEDATETIME(300109D,103000T);
TimeDuration := ProcessEnd - ProcessStart;
TotalHours := TimeDuration/3600;
Message('%1',TotalHours);

above code will give the exact time (hours) spent in a process.

Saturday, October 19, 2013

Microsoft.Dynamics.Nav.Types.NavDatabasePasswordException Dynamics NAV/ RTC/WebService

Hi All,
You may face this error when run RTC client or access NAV application using web services. and more over this error you will face in 3 tire installation

Cause
 if below mentioned services are not delegated properly then the users of RTC client will get an error stating that  "Microsoft.Dynamics.Nav.Types.NavDatabasePasswordException Dynamics NAV/ RTC/WebService"

since the services are not delegated then the user name which is used to log On the service only can connect RTC or WebServices

NAV Services are 
Dynamics NAV Server
Dynamics NAV Business Webserives

Solution
Delegate the services correctly
 
Setting up Delegation
http://msdn.microsoft.com/en-us/library/dd301254.aspx

 

How to Write Log File using CAL code - Dynamics NAV

Hi All
How to create a log file in Dynamics NAV try below steps, this sample code create a new log file (Log) in C:\
  • Create a new codeunit
  • Create following variables
  • Name                 DataType    Subtype    Length
    TestFile              File       
    TestStream        OutStream 
  • Paste below code at OnRun() save and run the codeunit     



TestFile.CREATE('C:\Log.txt');
TestFile.WRITEMODE(TRUE);
TestFile.OPEN('C:\log.txt');
TestFile.CREATEOUTSTREAM(TestStream);
TestStream.WRITETEXT (‘Success');
TestFile.CLOSE;
Message('Log Created Successfully')

Thanks
Marshal. J

Difference Between Form.Run and Form.RunModal - Dynamics NAV

Hi All,

What is the difference between Form.Run and Form.RunModal ?

Form.Run : if Form.Run used to run a form then NAV application  will allow the user to access other forms
Form.RunModal : if Form.RunModal used to run a form then NAV application will not allow the user to move other forms still close the current form


Thanks
Jerome Marshal