Microsoft Forum 2017


Microsoft Forum 2017

Mercoledì 8 marzoMiCo, Gate 3, Viale Scarampo, Milano

formum-2017-1

forum-2017

La 2Rivoluzione Industriale 4.0″ e i cambiamenti che sta generando sul mercato

La 2a edizione del più grande evento annuale di Microsoft rivolto ai decisori aziendali.
Dove l’industria italiana e l’innovazione convergono e danno vita a nuova conoscenza e nuove idee.”

Sessioni tematiche: cybersecurity, big data & analytics, intelligenza artificiale e cognitive services, IoT, smart working e smart collaboration, cloud computing, CRM & ERP, licensing.

Link  Evento https://www.microsoft.com/italy/microsoftforum/index.html

Registrazione Evento https://www.microsoftevents.com/profile/form/index.cfm?PKformID=0x12095982d53

Social  MSEventsITA@microsoft.com   #MSForum2017  #AccelerateBiz

 

navlab-foru-2017

LE SOLUZIONI INNOVATIVE DI NAV-lab al Microsoft Forum 2017

Anche quest’anno il gruppo NAV-lab partecipa attivamente all’evento e si pone tra i principali propositori di innovazione verso le PMI e verso la PA.

I nostri specialisti Dynamics vi accoglieranno nel nostro stand per ascoltare le vostre esigenze e fornirvi risposte concrete per la loro realizzazione:
Sempre nello stand vi presenteremo le nostre soluzioni specialistiche basate su Tempo Zero per Microsoft Dynamics NAV e Microsoft Dynamics 365 e vi mostreremo come abbiamo reso POSSIBILI progetti sofisticati sui nostri clienti.

Link  http://www.navlab.it/web11/news-Microsoft-Forum-2017.html

Vieni a trovarci !

Advertisements

Dynamics NAV New Books


Many ask in the forum about books\ebooks\kindles on Dynamics NAV 2017; actually there are no books on Dynamics NAV 2017 (…the same for Dynamics 365 Business Edition), many books have been updated at least to Dynamics NAV 2016.

Good News: “New books on Dynamics NAV will be released soon”.
Below you can find the title and release date of each book, i must point them, the upcoming books look very interesting !

nav-books

You can find books on Amazon or on PacktPub (also from other sites)

https://www.amazon.com   https://www.packtpub.com/

NAV books

Books currently purchasable

Implementing Microsoft Dynamics NAV – Third Edition (by Alex Chow)
http://amzn.to/2jKcTNd

hi already talked about this book long ago, take a look to my old post.
https://robertostefanettinavblog.wordpress.com/2016/04/15/new-book-implementing-dynamics-nav-2016-by-alex-chow/

Microsoft Dynamics NAV 2016 Financial Management – Second Edition
by Anju Bala
http://amzn.to/2k5fxhv

Extending Microsoft Dynamics NAV 2016 Cookbook
by Alexander Drogin
http://amzn.to/2kAtgwG    at this time i’m writing a review of this book (Kindle)

Einstieg in Microsoft S Dynamics NAV: Microsoft® Dynamics(tm) NAV 2016
http://amzn.to/2k5HndM
Books that will be released soon (only bookable books)

Building ERP Solutions with Microsoft Dynamics NAV (available from August 2017)
by Stefano Demiliani
http://amzn.to/2kANTZU

Mastering Microsoft Dynamics NAV 2016 (avalialble from September 2017)
Rabindra Sah
http://amzn.to/2k52YTv

Programming Microsoft Dynamics NAV – Fifth Edition (available from November 2017)
http://amzn.to/2jK3eGM

Have a nice reading !

“How-to” implement a Copy Loop in Word report layouts


“How-to” implement a Copy Loop in Word report layouts

Some time ago, I found this post on Microsoft Dynamics Community about: “No. of Copies” doesn’t work in Word Layout reports, “No. of Copies” works only on RDLC reports.

Example:

Report 1306 Standard Sales – Invoice, “N. Copies” on request page

Post Topic

“Hi experts,

I had to produce a report via Word layout in NAV 2015 and it had the “No. of Copies” option on the request page. However, this option doesn’t have any effect on the word report and it only prints one copy. If required to print more copies, the user has to either save or preview the word report and then do it as if from a word document.

Will the option “No. of Copies” only works for RDLC reports or is there a way I can get it working on the word layout as well?

Your comments/help will be much appreciated.

Thanks & Regards.”

Post Source https://community.dynamics.com/nav/f/34/p/215054/602685#602685

My Answer …after some tests:

“Hi, you are right!… “No. of Copies” doesn’t work in Word Layout report! .. after this i asked (some days ago) to NAV Team for a product improvementworkaround.”

Product Suggestion

“N. of copies” with Word Layout Reports.

I know that the option “No. of Copies” works only for RDLC reports (by design i think, this option is not existing on Mini World layout sample Reports) or is there a way i can get it working on the word layout as well?

If a user, either required printing more copies, this user has to “save” or “preview” the word report and then do it as if from a word document.

May be useful for “Post and Print” feature (“to print more copies.”..)

You can find my Product Suggestion here:

https://connect.microsoft.com/dynamicssuggestions/Feedback/Details/3118831

@Today, Solution is delivered by NAV Team Blog

“Because many partners asked to have this feature, an official solution (by my friend Duilio Tacconi of Microsoft) is today available. I tested this solution in preview before the post was published n NAV Team Blog, is a nice workaround, useful for “Post & Print” feature.

Source from NAV Team Blog

How to implement a Copy Loop in Word report layouts

https://blogs.msdn.microsoft.com/nav/2017/01/24/how-to-implement-a-copy-loop-in-word-report-layouts/

Well Done!

“How -to” restrict multiple logins for same user in NAV


Force logins limitations for some users can boost\improve system (few active Sessions..) as standard users can login in NAV multiple times, ex of real Scenario: CEO can have multiple logins, operational people NO !!

 NAV 2013 and Later

From NAV 2013 Microsoft created a table named: Active Sessions – Table ID 2000000110 This table contains information about all the active sessions, showing Connected Client Type\PC and Users)

Take a look to my previous post about “ALL ABOUT” Kill (In)active Sessions when “no more licenses”, with the VB.NET app in this post, you can show Client Type\PC and Connected User from this app to decide “who is the user” than try to use more than one NAV session.

Source https://robertostefanettinavblog.wordpress.com/2017/01/15/all-about-kill-inactive-sessions-when-no-more-licenses/


Starting from User Setup Table

You can add a boolean field “Multilogin” to User Setup Table (table 91)” ; with this boolean field you can check if user can login more times in NAV instead of only one time.

User Setup – Table ID 91 User Setup

ml-1

Before you need to add the new field “Multilogin” on Page “User Setup” (…or comment C/AL check code… you can’t login in anyway if you haven’t configured your user in this table)

..We can’t use System Table User.. because is used by System on Login process .. if you try to use this table you can’t start Windows Client…

ml-2

ml 3.png

To Restrict multiple logins we can use Login Codeunit

Codeunit 40 – LogInManagement

This codeunit is ht first fired on Login Time and I can add C/AL code here to trap user logins.
Steps: Open Codeunit 40, goto function CompanyOpen()

In CompanyOpen function add two new local variables: locUser and locActiveSessione

ml-4

Modify the CompanyOpen function in this way:

C/AL Code “Before” 

CompanyOpen()

IF GUIALLOWED THEN   LogInStart; C/AL Code “After”

CompanyOpen()

locUser.GET(UPPERCASE(USERID));

IF NOT locUser.Multilogin THEN

BEGIN

locActiveSession.RESET;

locActiveSession.SETRANGE(“User ID”,UPPERCASE(USERID));

locActiveSession.SETRANGE(“Client Type”, locActiveSession.”Client Type”::”Windows Client”); //For   RTC\Windows Clients

IF locActiveSession.COUNT > 1 THEN

ERROR(‘You are currently logged in NAV, you can’t have more sessions!’);

END;

IF GUIALLOWED THEN

LogInStart;

// Register all Microsoft Dynamics CRM connection strings

IF CRMConnectionSetup.GET THEN

CRMConnectionSetup.UpdateAllConnectionRegistrations;

Results

System abort login codeunit and display the Error Message “’You are currently logged in NAV, you can’t have more sessions!”; you can use\trap also others login types: ex: Web Client, Web Service, Background Sessions and so on.

ml 5.png

Another Nice Feature

You can decide also “how many sessions” each user can launch adding a “No. Sessions” field in User Table.

 ml-6

C/AL Code

CompanyOpen()

locUser.GET(UPPERCASE(USERID));

IF NOT locUser.Multilogin THEN

BEGIN

locActiveSession.RESET;

locActiveSession.SETRANGE(“User ID”,UPPERCASE(USERID));

locActiveSession.SETRANGE(“Client Type”, locActiveSession.”Client Type”::”Windows Client”); //For   RTC\Windows Clients

IF locActiveSession.COUNT > 1 THEN

ERROR(‘You are currently logged in NAV, you can’t have more sessions!’);

END

ELSE

BEGIN

locActiveSession.RESET;

locActiveSession.SETRANGE(“User ID”,UPPERCASE(USERID));

locActiveSession.SETRANGE(“Client Type”, locActiveSession.”Client Type”::”Windows Client”); //For   RTC\Windows Clients

IF locActiveSession.COUNT > locUser.”No. Sessions” THEN

ERROR(‘You are currently logged in NAV, you can’t have more than ‘ + FORMAT(locActiveSession.COUNT-1) + ‘ sessions!’);

END;

IF GUIALLOWED THEN

LogInStart;

// Register all Microsoft Dynamics CRM connection strings

IF CRMConnectionSetup.GET THEN

CRMConnectionSetup.UpdateAllConnectionRegistrations;

Results

ml-7

Bingo !

“ALL ABOUT” Kill (In)active Sessions when “no more licenses”


Sometimes it happens that there are “no more licenses available” for Dynamics NAV, from NAV 2013 R2 and next releases, it’s necessary to run the Windows Client or to use Powershell statements to kill some sessions and unlock others.
If you are unable to access to NAV (“no more licenses”), you should need to use SQL Console and kill sessions from there (reading from Active Sessions Table of from sysprocesses View on master db..)
“Some user don’t want to use SQL Server to achieve this !” …
WARNING : “No more licenses !!”   … Immediately Buy Others !!!
license1.png
There are many ways to kill sessions, i list below some methods.
With NAV Server Login
– C/AL
– Powershell
Without NAV Server Login
– SQL Server Stored Procedures\T-Sql
– VB .NET Application
Below some methods to kill the sessions even in the case of “no more licenses available“: SQL Script and VB.NET
C/AL Statement to Kill Sessions
The Standard Statement for C/AL Code is:  STOPSESSION(“Session ID”);
Example:
IF CONFIRM (‘Kill Session ?’) THEN STOPSESSION(“Session ID”) … GOAL !
…. BUT YOU NEED TO CONNECT TO NAV SERVER !  .. sometimes is NOT possible!
———————————————————-
My VB.NET Solution
“I wrote a simple solution on VB.NET to Kill Active Sessions using a SQL Connections,
you cand find it on GITHUB and TECHNET.”
ON GITHUB
ON TECHNET
Post link
Download link
About My VB.NET Simple Solution, some pictures
kill1
kill-2
kill-3
App Config File
<?xml version=”1.0″ encoding=”utf-8″ ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name=”NAV_2017_KIll_SQL_Inactive_Sessions.My.MySettings.Demo_Database_NAV__10_0_ConnectionString”
connectionString=”Data Source=STEFANETTILEN\SQL2012ENT;Initial Catalog=&quot;Demo Database NAV (10-0)&quot;;Integrated Security=True”
providerName=”System.Data.SqlClient” />
</connectionStrings>
<startup>
<supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.5″ />
</startup>
</configuration>
———————————————————-
SQL KILL STATEMENTS
KILL (Transact-SQL)
– Syntax for SQL Server, Syntax for Azure SQL Data Warehouse and Parallel Data Warehouse

KILL ‘session_id’ [;]    
Source https://msdn.microsoft.com/it-it/library/ms173730.aspx

KEEP IN MIND !!!   DON’T KILL PROCESSES IN THIS STATES:
-AWAITING COMMAND
-CHECKPOINT SLEEP
-LAZY WRITER
-LOCK MONITOR
-SIGNAL HANDLER
My Customized release
1) SP_SQL_KillNavServerSession
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
— =============================================
— Description: KILL ALL NAV ACTIVE USER SESSSIONS WITH MULTIPLE INSTANCES
— =============================================
CREATE PROCEDURE [dbo].[SP_SQL_KillNavServerSession]
AS
BEGIN
DECLARE @RowIndex AS INT;
DECLARE @MaxIndex AS INT;
 SET @RowIndex = 1;
SELECT @MaxIndex =
(SELECT top 1 MIN([Session ID])
FROM [ITA].[dbo].[Active Session]
WHERE [User ID] = ‘************’
group by [Session ID])
 — Remove Active Session
DELETE FROM [DB].[dbo].[Active Session] where [Session ID]>@MaxIndex AND [User ID] = ‘*********’
END
2) SP_SQL_KillNONavSession
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
— =============================================
— Description: KILL SLEEPING NO NAV SESSIONS
— =============================================
CREATE PROCEDURE [dbo].[SP_SQL_KillNoNavSession]
AS
BEGIN
DECLARE @Session TABLE
(
id INT IDENTITY(1,1) PRIMARY KEY,
[sid] int,
ltime DATETIME,
hname varchar(MAX),
uid varchar(100),
lret datetime,
etime int
);
DECLARE @NotAffectedUserList TABLE
(
id INT IDENTITY(1,1) PRIMARY KEY,
[uid] varchar(MAX)
);
DECLARE @session_time as int;
DECLARE @vSID as int;
DECLARE @command as varchar(MAX);
DECLARE @RowIndex AS INT;
DECLARE @MaxIndex AS INT;
set @session_time=15; — Assign Session time in Minutes
— Assign List of Users who “will not be affected” by this Session Kill
INSERT into @NotAffectedUserList SELECT ‘sa’
INSERT into @NotAffectedUserList SELECT ‘NT AUTHORITY\SERVIZIO DI RETE’
INSERT into @NotAffectedUserList SELECT ‘**************’
INSERT into @NotAffectedUserList SELECT ‘scheduler’
INSERT into @Session
SELECT
session_id as [Session ID],
login_time as [Login Time],
host_name as [Host Name],
LOGIN_NAME as [Login ID],
last_request_end_time as [Last Request End Time],
DATEDIFF(minute,  last_request_end_time,getdate()) as[Elapsed Time (minutes)]
FROM
sys.dm_exec_sessions
WHERE
open_transaction_count = 0
AND host_name <> ‘NAVSRV’ COLLATE Latin1_General_CI_AS
AND host_name is not NULL
AND DATEDIFF(minute,  last_request_end_time,getdate())>=@session_time
–AND client_version=4
AND login_name COLLATE Latin1_General_CI_AS not in
(
SELECT DISTINCT uid
FROM @NotAffectedUserList
)
SET @RowIndex = 1;
SELECT @MaxIndex = MAX(id) FROM @Session;
WHILE( @RowIndex <= @MaxIndex)
BEGIN
SELECT @vSID = sid
FROM @Session
WHERE id = @RowIndex;
 — String together the KILL statement
SELECT @command = ‘KILL ‘ + CAST(@vSID AS varchar(5))
 BEGIN TRY
  — Execute the final string to KILL the spids
EXEC (@command)
END TRY
BEGIN CATCH
declare @emsg varchar(500);
SELECT
@emsg=ERROR_MESSAGE();
  print @emsg;
END CATCH
 SET @RowIndex = @RowIndex + 1;
END;
END
// KILL SQL INACTIVE SESSIONS FOR NAV APPLICATIONS
// ONLY FOR SLEEPING SESSIONS – OLD NAV CLIENTS
a very Simple SQL Stored Procedure to ‘kill’ sql inactive sessions
idle (sleeping) for 10 minutes related to “Nav Client” applications
*** it’s necessary to identify correct “application name” ***
*** ex: program_name LIKE N’%NAV client% *** or %NAV Web%
DECLARE @v_spid INT
DECLARE c_Users CURSOR
FAST_FORWARD FOR
SELECT SPID
FROM master..sysprocesses (NOLOCK)
WHERE spid>50
AND loginame <> ‘DIR%’
AND program_name LIKE N’%NAV client%’
AND status=’sleeping’
AND DATEDIFF(mi,last_batch,GETDATE())>=10
AND spid <> @@spid
OPEN c_Users
FETCH NEXT FROM c_Users INTO @v_spid
WHILE (@@FETCH_STATUS=0)
BEGIN
PRINT ‘Killing ‘+ CONVERT(VARCHAR,@v_spid)+’…’
EXEC(‘KILL ‘+ @v_spid)
FETCH NEXT FROM c_Users INTO @v_spid
END
CLOSE c_Users
DEALLOCATE c_Users
———————————————————-
OTHERS NICE SOLUTIONS (NAV LOGIN IS REQUIRED)
Olof Simren Solution
Kill Sessions in Dynamics NAV (from NAV Page)
Source https://www.olofsimren.com/kill-sessions-in-dynamics-nav/
Gunnar Solutions
ADO NET Solution
Kill Idle Connections
Source http://www.dynamics.is/?p=471
Poweshell Solution
Stopping Idle Microsoft Dynamics NAV Services
Nice Sessions Killing !

Azure Days – Milano, 26 gennaio


“Azure Days”, 26 gennaio 2017 – 09:00 – 18:00

azure-days

Fondazione Feltrinelli
Via Alessandro Volta 23, Milano (MI)
“Nell’era della Digital Transformation, il Cloud di Microsoft permette alle organizzazioni di realizzare il proprio percorso di innovazione garantendo sicurezza e scalabilità.
Azure è al centro di questo momento di trasformazione strategica grazie alle proprie caratteristiche in termini di compliance, funzionalità di sviluppo e di gestione della infrastruttura.
Partecipa agli Azure Days per approfondire tutti questi aspetti con l’aiuto di partners, ISV ed esperti del settore.”
TOPICS
azure-days1
Azure Days Short Link Evento  http://buff.ly/2iDNzcf

How To setup “Keep Alive Interval” setting NAV2016-NAV2017


Many posts in forums about this topic; some people report that Idle Client Timeout configured in NAV Administration is not working.
Example of scenario: “Users logs in to the Navision by windows client installed on their PC but after setting idle client timeout session for 3 minutes then also it does not log off after 30 minutes also.”
or
Automatically Idle Client Timeout – NAV2016 – doesn’t work!
http://forum.mibuso.com/discussion/66081/automatically-idle-client-timeout-nav2016-doesnt-work

History of ClientKeepAlive setting
Since the October 2015 cumulative updates, the Dynamics NAV Windows client timeout configuration was managed at the service level by setting the Idle Client Timeout setting.

“The October 2015 cumulative updates added a new setting: “ClientKeepAlive”.
This  setting is managed at the user level and located in the ClientUserSettings.config file.

The value of this setting is given in seconds and defines the interval between ‘pulse’ signals sent by the client to prevent the client from going idle in some scenarios, or for some users.

ClientKeepAlive: about this setting

  1. In the server configuration file, set Idle Client Timeout  to 00:10:00
  2. In the client configuration file, set ClientKeepAlive  to any value  larger than 600
    This value is in seconds, so 600 equals 10 minutes.

Microsoft, by popular demand, changed in Dynamics NAV 2016 Cumulative Update 8:
The ClientKeepAlive setting has been moved from the user level to the service level: “Keep Alive Interval “, and is no longer defined in number of seconds but as a time interval, just like the Idle Client Timeout setting.”

Keep Alive Interval : about this setting

So following our example above, to configure a timeout interval for the Dynamics NAV Windows client to 10 minutes, in Dynamics NAV 2016 Cumulative Update 8 and later, you must set the following:

  1. In the server configuration file, set Idle Client Timeout  to 00:10:00
  2. In the server configuration file, set Keep Alive Interval  to a value larger than 00:10:00

PS: If you are running on a NAV 2016 build earlier then CU 8, your clientkeepalive settings will still be located Client side, in ClientUserSettings.config

Web Client
“To configure the timeout for the Dynamics NAV Web client, it is sufficient to configure the SessionTimeout setting in the web.config file to the relevant interval – in our example it’s 00:10:00.”

PS: Check your NAV Release and build for correct configuration!

Sources:
Configuring Client Timeout
https://blogs.msdn.microsoft.com/nav/2016/06/24/configuring-client-timeout/

Understanding Session Timeouts NAV 2016-NAV 2017
https://msdn.microsoft.com/en-us/library/dn789725(v=nav.90)