My tips

A Mibuso.com weblog

New Report UX Guidelines for NAV RTC-reports

“New Report UX Guidelines” for RTC/RDLC-reports from Claus Lundstrøm/Microsoft Dynamics NAV Team Blog

The films on YouTube show to work easy with RDLC-reports: Here

January 31st, 2012 Posted by christer | RTC-reports, Uncategorized | no comments

Samsung Office Server 7100 / 7200 / 7400 + Dynamics NAV = TRUE

Last week I was involved in installed the software “Samsung Xchange” so now one of my clients can both dial out from Dynamics NAV, an incoming call shows the customer card or the business card in Dynamics NAV. The program need to have read-access to NAV-db…

Samsung Xchange has a lot of options such as Google maps, LinkedIn, Facebook etc.

Links:   Samsung xChange , YouTube

Today 2012-01-30
The picture was taken today when went to the subway. (Lat N 59° 15′ 5″ Lon E 18° 1′ 38″)

It was -15° celsius..

January 30th, 2012 Posted by christer | Samsung Office Server, TAPI | one comment

SQL-Util to unlock NAV-db

After you have restored a NAV SQL database to your PC, you may need to unlock the database.

Here is my sql-script: SQL-tool to unlock NAV-DB (SQL-server)

This script creates a new user “TEMPUSER’ in SQL Server and NAV-database so you can log on to the NAV system.


--***************************************************************
--* Set a new user to a Dynamics NAV SQL-database
--*
--* Christer Berntsson, Sweden
--* Ver 2011-12-21
--*
--***************************************************************

use YourDatabase
go

--Create a new user in Your SQL-server
--Usersername must be upercase!
CREATE LOGIN [TEMPUSER]
WITH PASSWORD='1234!"#¤',
DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english],
CHECK_EXPIRATION=OFF,
CHECK_POLICY=OFF

EXEC sys.sp_addsrvrolemember @loginame = N'TEMPUSER', @rolename = N'sysadmin'
GO
--Set User to NAV-database
INSERT INTO [dbo].[User]
([User ID] ,[Password] ,[Name] ,[Expiration Date])
VALUES
('TEMPUSER', '', '', '1753-01-01')

--Set ROLS
INSERT INTO [dbo].[Member Of]
([User ID] ,[Role ID] ,[Company])
VALUES
('TEMPUSER', 'SUPER', '')

January 26th, 2012 Posted by christer | SQL-Script | one comment

View data in a webpage.

One example to view data in a web using VB.NET through a Web service in Nav 2009 SP1/R2.

Ingredients:

  1. Visual Studio 2010
  2. Dynamics NAV 2009 R2

How to:
Part 1: Publish a page-webservice inside Dynamics NAV RTC

Goto Web Services (Administation -> IT Administation -> General -> Web Services)

Click New and select Object type= Page, Object ID = 367 set Services Name to “PostCodes” and select “Published”

Post1 Pic1

Now we have to check if the webservice is running

(windows) Start-> Run (or search) ->services.msc

“Microsoft Dynamics NAV Business Web Services” must be running.

Post1 Pic13


Part 2: Create webproject

    Start up Visual Studio
    Create a new project

    Select

    1. Visual Basic
      • .NET Framework 3.5
      • ASP:NET Web Application
      • Give the project a Name (WebAndNav)xxxxxx
      • Select “Create directory for solution”In Visual Studio2010Right click the project and select ”Add Web reference”In the URL write the address to your new webserviceThis can be little tricky, in my Swedish version I wrote:”http://localhost:7047/DynamicsNAV/WS/CRONUS Sverige AB/Page/PostCodes”

      and when clicked the green button its changes to:
      “http://localhost:7047/DynamicsNAV/WS/CRONUS%20Sverige%20AB/Page/PostCodes”

      Select a name for “Web reference name” (WebRefPostCodes)

      And finally hit “Add Reference”

      Post1Pic3

      In Visual Studio drag a GridView from Toolbox Data to the webpage in the div-box

      post1pic4

      In Visualstudio Drag a ObjectDataSource from Toolbox Data to the webpage in the div-box

      post1pic5

      Now it’s time to update the project with a Build. (to update the project)

      post1pic6

      Now it’s time to configure ObjectDataSource and GridView

      Select the ObjectDataSource1 and click the small arrow and select “Configure Data Source”

      post1pic7

      Select “WebAndNav.WebRefPostCodes.PostCodes_Service”

      and press “Next”

      post1pic8

      Select “ReadMultiple(postCodes_Filter[],String BokmarkKey, Int32 setSize)” and press “Next”

      post1pic9

      Press “Finish”

      post1pic10

      Next step is configure gridview:

      Select the GridView and click the small arrow and chose Data Source “ObjectDataSource1”

      post1pic11

      post1pic12

      Now it’s time to test!!

      Back to Visual Studio

      Hit F5 or the green “Run button”

      post1pic14

      It works! but we need some filters.

      Close the browser and we are sent going back to Visual Studio.

      post1pic15

      Add a TextBox and a Button to the webb-page this will be our filter.

      post1pic16

      DoubleClick the button and this code

      post1pic17

      Public Class   _Default

      Inherits System.Web.UI.Page

      Dim wsFilter As New List(Of WebRefPostCodes.PostCodes_Filter)

      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

      If Not IsPostBack Then ‘ Run when the page is new

      Me.TextBox1.Text = “14100..14199″ ’set a defaultvalue

      wsFilter.Clear()

      ‘Clear filter

        Dim wsfilter1 As New WebRefPostCodes.PostCodes_Filter() ‘create a filter

      wsfilter1.Field = WebRefPostCodes.

      PostCodes_Fields.Code ‘filter on “code”

      wsfilter1.Criteria =Me.TextBox1.Text ‘get filtervalue from textbox

        wsFilter.Add(wsfilter1) ‘add filter to filterarray

      Else ‘ Run when the page is “old”

      Dim

      wsfilter1 As New WebRefPostCodes.PostCodes_Filter() ‘create a filter

      wsfilter1.Field = WebRefPostCodes.PostCodes_Fields.Code ‘filter on “code”

      wsfilter1.Criteria = Me.TextBox1.Text ‘get filtervalue from textbox

      wsFilter.Add(wsfilter1)‘add filter to filterarray

      Me.ObjectDataSource1.Select() ‘run the select

      Me

      .GridView1.DataBind() ‘bind data to gridview

      End If

      End Sub

      Protected

      Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click

      End

      Sub

      Protected

      Sub ObjectDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ObjectDataSource1.Selecting

        e.InputParameters(“filter”) = wsFilter.ToArray ‘Important: converts filters to array
      e.InputParameters(“SetSize”) = 1000 ‘fetch 1000 records

      End Sub

      End

      Class
       

      Time to format our gridview …

      1. Enable paging (red 1)

      post1pic18

      2. Hide the Key-column (red 2)

      post1pic19

      3. Chose a format (red 3)

      post1pic20
      Time to test press F5 or the run button
      The filter is working! Three different filters.

      post1pic21

      // The end

      October 24th, 2011 Posted by christer | VB.NET, WebServices | 4 comments

Hallo world,

Hallo reader,

I’m a fan of NAV and VB.NET so my posts will mostly will include that parts.

Regards

Christer

October 24th, 2011 Posted by christer | Uncategorized | no comments