O'Reilly logo

Microsoft Dynamics NAV 2009 Programming Cookbook by Matt Traxinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scheduling NAV tasks from SQL Server

You cannot call NAV code directly from outside the database, but you can create a .NET program that can be used by SQL to issue commands through a NAV web service. This recipe will show you exactly what to do.

How to do it...

  1. Create a new SQL CLR project in Visual Studio. When creating this project you will have to add a reference to your NAV database.
  2. Right-click on your project in Solution Explorer and add a new stored procedure named NAVJobScheduler.
  3. Add the following code to the project:
    using System; using System.Net; using System.IO; using System.Xml; public partial class StoredProcedures { [Microsoft.SqlServer.Server.SqlProcedure] public static void NAVJobScheduler( string ObjectType, int ObjectID, string ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required