Data from SQL View not being refreshed

beboelkebeboelke Member Posts: 19
edited 2013-02-13 in NAV Three Tier
In 2013 I have established a SQL View and associated it with a linked table. The data that is presented when opening the Page within NAV for this View never updates during the session. I can confirm that the data has in fact changed by running a select query against the View, but until I exit NAV and restart the client, the data in NAV is stale. I have tried triggering sp_refreshview when the page is opened, but this did not have any impact. The only way to refresh the data I've found so far is exit/restart. Does anyone have any suggestions?

Comments

  • beboelkebeboelke Member Posts: 19
    After more experimintation it turns out the Page is not refreshing when it loads. If the underlying data has been changed, the only way I've found for the page to display it is to hit F5.

    One thing I failed to mention - this is a List Page.
  • kaelaakaelaa Member Posts: 28
    Did you a find the cause of this?
    I am experiencing the same problem when updating a custom table from SQL in NAV 2013.
    The only way to update the data on the Page is to click Refresh.
    Closing and opening NAV doesn't even help.

    Thanks
  • eknraweknraw Member Posts: 26
    I think you're running into issues with the new caching features of the 2013 NST.

    http://msdn.microsoft.com/en-us/library/hh169480(v=nav.70).aspx

    See the part about SELECTLATESTVERSION.

    I created two simple tables with an int and nvarchar column and a SQL view that would join on those int values, attached a table and a page. I verified that the view would change as I added data, and then ran both the table and the page in NAV which reflected the old state of the view. If I add SELECTLATESTVERSION to the OnInit (OnOpenPage() works as well) trigger of the Page the data in the Page reflects what I would see in the view in Management Studio.

    Hopefully, that fixes your issue.

    Bill
Sign In or Register to comment.