Detect when table gets updated

Hello,

We currently have Windows services (written in C#, .NET) that push data out from some Sage tables to a custom API, which then stores it in a private SQL Server Database. Depending on the service, it might trigger every minute, every 5 minutes, or once every day.

We are looking for a real-time end result since the current implementation presents delays in synchronizing data.

Is there a way to trigger our code somehow when data in a specific table gets added, updated, or deleted?

Cheers,
Imad

Parents Reply
  • 0 in reply to Kevin M

    In fact, the issue is somewhere in my objects. But I can't figure out where. See the following trace window:

    I updated the same item 3 times in a row without closing the window. I can see that the script has been triggered 3 times. However, the API call is never re-made because my API response is a GUID that should change every time, which is not happening. In addition, my API only logs the reception of requests the first time. It's like my API is never called if the URL is the same (because it gets triggered if I change the item or if I close and then re-open the window).

    Here is my updated script:

    retVal = oScript.DebugPrint("Script Triggered")
    
    url = ""
    itemCode = ""
    response = ""
    
    retVal = oBusObj.GetValue("ItemCode$", itemCode)
    url = "https://localhost:7017/Synchronization/ping/" & itemCode & ""
    
    retVal = oScript.DebugPrint("URL: " & url)
    
    Set o = CreateObject("MSXML2.XMLHTTP")
    
    o.open "GET", url , False
    o.send
    response = o.responseText
    oScript.DebugPrint("Response: " & response)
    
    Set o = nothing
    Set itemCode = nothing
    Set url = nothing
    Set response = nothing

    Moreover, if, instead of sending the item code (which never changes) in the URL, I send the description (which I am updating for the sake of testing), the API call is made successfully because the URL has changed.

    Is there a sort of a cache that is used?

Children