Navision SQL client not always getting current data

fweeeefweeee Member Posts: 14
Hello all,

I have been looking into a clients problem of data not updating very quickly, and I am wondering if anyone has anything to add on this.
Basically, whats happening, is that when one user updates a field (the example given is the blocked field on the Customer Card), Another user cannot see this update for some time - anywhere from 10 seconds to several minutes.

I have done some testing with this, and found it to be universal (as in, different tables/fields, and different versions of Navision). Also, the problem seems to be with the reading of data from the SQL DB, not the writing of data to the SQL DB, as Querey Analyser is able to see the updated data instantaniously.

A quick description of my testing methodology:
1) Open up two Navision clients, and open the same SQL Database with them. These will henceforth be called NC1 (Navision Client 1) and NC2 (Navision Client 2).
2) Open up SQL Query Analyzer. Prepare an SQL statement that will return the value of a specific field (say blocked) for a specific record in a specific table (say Customer).
3) In NC1, open up the customer Card. Changed the value of the field (Blocked). Leave the record to ensure that it is updated in the Database (go to the next record, come back).
4) Refresh the Query in Query Analyser - it always reflects the update done in NC1.
5) Go to the same record in NC2. It should be the old value (if you have moved quickly enough).
6) For bonus points, try to change the value of the field (blocked) in NC2. It will complain that another user has changed this record after you retreived it from the database.

I have tested this in a number of places now - using a 3.70 Navision Client running from the clients database server, a 3.70 client on my own SQL server, and a 4.00SP1 on my own SQL server.

I have found that the 3.70 client is consistantly slow to update (5 seconds or more), sometimes the 4.00SP1 is instantaniously updated, mostly it is not.

Talking to my colleagues, some of them have also experienced this, but none of them could offer a soution.

Has anyone else dealt with this? If so, can you offer an explaination/solution?

Thanks.

Shanon.

Comments

  • ara3nara3n Member Posts: 9,257
    If it's a form that many people are working on a lot. Give the user a button to refresh the record.
    on push trigger of the button add

    currform.update(false);


    Every client has a cache. That's where the records are kept.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • fweeeefweeee Member Posts: 14
    Thanks Rashed,

    Your snippet of code works, but I was hoping there was some way of getting Navision to refresh the data automatically.

    I wasnt actually aware that Navision kept a cache of data in the client - I knew there was a cache for objects, but not data. (I would have thought that the data would be retreived each time the user accessed it).

    Shanon.
  • ertoerto Member Posts: 2
    you can also use OnTimer trigger, and do an currform.update,
    or have the user do it by pressing Ctrl+Alt+F5
    However, for performance reasons, the way Navision handles this now is best, in my experience
  • ara3nara3n Member Posts: 9,257
    I wouldn't recomend ontimer because if the user is typing while ontimer triger is run, they will lose all the data they were typing. It's very annoying.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ErichErich Member Posts: 2
    You also can use "SELECTLATESTVERSION" to be shure.

    When you use SELECTLATESTVERSION, Navision reads the database, not the cache
  • ara3nara3n Member Posts: 9,257
    I guess you could put SELECTLATESTVERSION on OnAfterGetRecord().
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.