Realtime page updates from codeunit

kevindstanleykevindstanley Member Posts: 11
edited 2013-08-09 in NAV Three Tier
Hi,

I have a codeunit that is exposed as a webservice that gets update periodically, but event-driven, it could be every second or sometimes every half hour depending on the time of day.

This is the scenario I have.
-Codeunit updates TableA
-3 users are looking at PageA(that uses data from TableA)
-3 users are looking at stale data

Is there a way for the data that the 3 users are currently looking at update in an event driven fashion, meaning as to not use timers and have the codeunit tell the pages to updates.


Thanks!
Kevin

Comments

  • kevindstanleykevindstanley Member Posts: 11
    here is an update on my research.

    Would it be possible to create a dotnet client Add-In that uses Microsoft's new SignalR library to subscribe(listen) to a server for changes, and when there are changes fire the RaiseControlAddInEvent in the Add-In to run some C/AL code (CurrPage.UPDATE) inside of the C/AL's Add-In .

    With signalR, every client that is connected receives messages from a 'server' broadcast. I would just write the server to use localhost:port and point all of the clients to that servers ip:port to listen.

    I have done some work with signalR in the past, i don't know how well Nav plays with Async dotnet though... or if it would work with this library at all.

    If I have time to write up a demo I will post my findings. Let me know if anyone has tried something like this.
  • ara3nara3n Member Posts: 9,256
    You don't need signal IR. You can use simple socket and connect to a server. sending and receiving Asynchronously. There is MSDN example available for a server and client.
    And yes you can do it through Addin.
    Ahmed Rashed Amini
    Independent Consultant/Developer


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