Specifying record Key field in web services

jmshinnjmshinn Member Posts: 3
edited 2014-05-01 in NAV Three Tier
I'm working on a data export to keep a website updated, and I'm building a table to act as a queue for any changes that occur that can then be grabbed and pulled out through webservices.

In order to make this as simple as possible, I'd like to record the Key field in my table whenever a table I'm interested in is updated, but I realize this key isn't really used directly in this way throughout the system. Is the Key field reliable? Is there a reason I should avoid using it in this way, and instead use the actual Primary Key fields set for that table, or can I use it to indicate that a particular record needs to be looked at? Does it ever change?

I should probably use the primary key fields anyway, since that's how I'm recording the reference on our web site (and it's the only way to handle record deletions anyway), but I'd like to understand more about the Key field, how it's used, and why it seems to be more of a background field than an actual primary key.

Answers

  • jmshinnjmshinn Member Posts: 3
    In further searching (and other questions), it looks like the "Key" field to which I'm referring is actually some sort of serialized representation of the actual primary key in concert, maybe, with a timestamp of the last update, which would mean each key is transient rather than a true primary key in the way I'm used to thinking about them, and thus not compatible with the way I'm talking about using it here.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Yes, you are right. Key isn't really a field. That confused me also when I started to use NAV Web Services.

    Btw, were you able to call the Delete (or Update) method of your NAV Web Service without calling the Read method beforehand? I mean you probably know the Primary Key of that record, but you're still not allowed to change it until you use the current "Key" value? Were you able to generate "Key" without calling the Read method?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.