The Object Change Listener component of Microsoft Dynamics NAV Server monitors the database for changes that are made to application objects, such as adding a new field to a page. When the Object Change Listener detects that a change has been made to an application object, it flushes the application object from the server-side cache, which causes clients to get a newer version from the database.
For the Object Change Listener to start, Microsoft Dynamics NAV Server must have permissions to the SQL Server database. If Object Change Listener cannot start because of permissions errors, then you cannot connect any clients to the server. When you try to start the RoleTailored client, you see the following message:
Cannot connect the Change Listener to SQL Server.
This topic provides guidelines for determining if you must enable the Object Change Listener on the computer running Microsoft Dynamics NAV Server. It also provides instructions for enabling the Object Change Listener in SQL Server Management Studio and instructions for enabling query notification for the Object Change Listener, which is an optional step that can help improve performance.
Determining If You Must Enable the Object Change Listener
For certain installation configurations, you must manually enable the Object Change Listener. The following table explains the configuration options.
Account choice | Microsoft Dynamics NAV Server and database on same computer | Microsoft Dynamics NAV Server and database on different computers |
---|---|---|
Network Service account |
No Object Change Listener additional configuration is required unless you attach databases manually. |
|
Domain user account |
|
|
Enabling the Object Change Listener
To enable the Object Change Listener, follow these steps:
To enable and assign minimum permissions for the Object Change Listener
-
Open SQL Server Management Studio. and then connect to your SQL Server instance.
-
On the File menu, point to New, and then click Query with Current Connection.
-
Type the following SQL statements.
Copy Code USE MASTER CREATE LOGIN [ReplaceWithNAVServerAccount] FROM WINDOWS; GO
-
Highlight the lines that you typed and, on the Query menu, click Execute.
-
Now type these lines below the existing lines.
Copy Code USE [ReplaceWithYourDatabaseName] CREATE USER [ReplaceWithNAVServerAccount] FOR LOGIN [ReplaceWithNAVServerAccount];
-
Highlight the lines that you just typed and, on the Query menu, click Execute.
-
Now type these lines below the existing lines.
Copy Code CREATE SCHEMA [$ndo$navlistener] AUTHORIZATION [ReplaceWithNAVServerAccount]; GO
-
Highlight the lines that you just typed and, on the Query menu, click Execute.
It's very possible that you will see an error stating that the schema in question already exists. This is not a problem.
-
Now type these lines below the existing lines.
Copy Code ALTER USER [ReplaceWithNAVServerAccount] WITH DEFAULT_SCHEMA = [$ndo$navlistener]; GRANT SELECT ON [Object Tracking] TO [ReplaceWithNAVServerAccount]; GO
-
Highlight the lines that you just typed and, on the Query menu, click Execute.
Note The Object Tracking table name may be in a different language than English. If it is, then replace "Object Tracking" with the actual table name from your database.
-
On the Query menu, click Execute.
Enabling Query Notification for the Object Change Listener
Enabling query notifications is not required but can improve performance when the Object Change Listener is listening for changes.
To enable query notification for the Object Change Listener
-
Open SQL Server Management Studio.
-
On the File menu, point to New, and then click Query with Current Connection.
-
Type the following SQL statements:
Copy Code ALTER DATABASE [ReplaceWithYourDatabaseName] SET ENABLE_BROKER; GRANT CREATE PROCEDURE TO [ReplaceWithNAVSrvrAcct]; GRANT CREATE QUEUE TO [ReplaceWithNAVSrvrAcct]; GRANT CREATE SERVICE TO [ReplaceWithNAVSrvrAcct]; GRANT VIEW DEFINITION TO [ReplaceWithNAVSrvrAcct]; GRANT SUBSCRIBE QUERY NOTIFICATIONS TO [ReplaceWithNAVSrvrAcct]; GRANT RECEIVE ON QueryNotificationErrorsQueue TO [ReplaceWithNAVSrvrAcct]; GRANT REFERENCES ON CONTRACT::[http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification] TO [ReplaceWithNAVSrvrAcct]; GO
-
On the Query menu, click Execute.