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.

  • Object Change Listener configuration is required.

  • In the following procedures, specify YourDomain\YourMachineName$ for ReplaceWithNAVSrvrAcct.

Domain user account

  • Object Change Listener configuration is required.

  • In the following procedures, specify the domain user account for ReplaceWithNAVSrvrAcct.

  • Object Change Listener configuration is required.

  • In the following procedures, specify the domain user account for ReplaceWithNAVSrvrAcct.

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

  1. Open SQL Server Management Studio. and then connect to your SQL Server instance.

  2. On the File menu, point to New, and then click Query with Current Connection.

  3. Type the following SQL statements.

      CopyCode imageCopy Code
    USE MASTER
    CREATE LOGIN [ReplaceWithNAVServerAccount] FROM WINDOWS;
    GO
    
  4. Highlight the lines that you typed and, on the Query menu, click Execute.

  5. Now type these lines below the existing lines.

      CopyCode imageCopy Code
    USE [ReplaceWithYourDatabaseName]
    CREATE USER [ReplaceWithNAVServerAccount] FOR LOGIN [ReplaceWithNAVServerAccount];
    
  6. Highlight the lines that you just typed and, on the Query menu, click Execute.

  7. Now type these lines below the existing lines.

      CopyCode imageCopy Code
    CREATE SCHEMA [$ndo$navlistener] AUTHORIZATION [ReplaceWithNAVServerAccount];
    GO
    
  8. 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.

  9. Now type these lines below the existing lines.

      CopyCode imageCopy Code
    ALTER USER [ReplaceWithNAVServerAccount] WITH DEFAULT_SCHEMA = [$ndo$navlistener];
    GRANT SELECT ON [Object Tracking] TO [ReplaceWithNAVServerAccount];
    GO
    
  10. Highlight the lines that you just typed and, on the Query menu, click Execute.

    NoteNote

    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.

  11. 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

  1. Open SQL Server Management Studio.

  2. On the File menu, point to New, and then click Query with Current Connection.

  3. Type the following SQL statements:

      CopyCode imageCopy 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
    
  4. On the Query menu, click Execute.

See Also