0

I am exposing some Pages in Navision 2009 as web services. To update a record, you have to issue a Read request, and send the Key field along with your Update request.

I would rather calculate the Key myself for 2 reasons:

  1. Using the filters in the read request is awkward - a sql query would fit on one line.
  2. Performance is terrible.

I've been able to figure out that at least part of the key is a Base64 encoded string of the columns that make up the primary key. I hope that someone can tell me where to look (database, code base, docs, etc) to tell me how the Key is calculated.

João Bragança
  • 1,353
  • 1
  • 13
  • 29
  • If you dont't _Read_ record how do you know it exists? If you want to modify it then it must be already in database. – Mak Sim Jun 21 '13 at 07:22
  • A SQL query, which is orders of magnitude more performant. – João Bragança Jun 21 '13 at 14:00
  • You want to insert with sql query and update with ws-call? – Mak Sim Jun 24 '13 at 05:47
  • No. I want to insert / update / delete with the web services and query with SQL. That's why I tagged the post 'CQRS' - The idea is you use one interface optimized for Commands - something that changes state - and another interface optimized for Queries - something that answers a question. – João Bragança Jun 24 '13 at 16:38
  • Maybe the rest of the key is SQL's timestamp? – Mak Sim Jul 03 '13 at 13:59

1 Answers1

0

Sorry, I don't know how to calculate the key. Instead of calculating the key, have you considered doing your data manipulation in a codeunit instead, and exposing that codeunit as a webservice?

Jan Hoek
  • 702
  • 5
  • 13
  • Doesn't make economic sense. We would have to purchase a developer license and then additional code units. Even if I were a C/AL developer, it would take several weeks doing it that way just to break even on cost. – João Bragança Jun 20 '13 at 16:42
  • Ah, I see. You may be right. On the other hand, since the algorithm for building the key is not documented anywhere, it may be subject to change without any prior notice from Microsoft? – Jan Hoek Jul 01 '13 at 07:28