How do I...?

How to RESTfully add a record that references a record in another table?

I am developing an interface from a C# web application to TrackVia that will maintain [Work Orders] and [Work Order Line Items] in lock-step with our web application's SupplyRequest and SupplyRequestItem tables. We will use your REST API to perform CRUD transactions. The [Work Order] view includes foreign keys to the Locations table. The [Work Order Line Items] view includes foreign keys to the [Work Orders] and [SKUs] tables. Can you point me to an example of how to insert and update records that include foreign keys? I'm guessing that we need to specify the integer record ids of the referenced entities, but it would be so much easier if we could use some other unique string identifier.

1 vote
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Carl Kelley shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Carl Kelley commented  ·   ·  Flag as inappropriate

    Further experiments have confirmed my suspicion that the internal TrackVia id is needed to reference foreign keys. So, if a Location is represented as a name in the GUI, you need to replace the name with the integer id of that record when adding or updating a record that references it.

Feedback and Knowledge Base