Forum Discussion

tsherwood's avatar
tsherwood
Regular Visitor
9 years ago
Solved

REST API Post rows to dependent table?

I have created a dataset via REST that has four tables: A, B, C, D. Table B has a dependent relationship on A, and D has a dependent relationship on B & C.   I wrote a program to load the data in t...
  • tsherwood's avatar
    tsherwood
    9 years ago

    I discovered the error to be failure to close the previous response object. For your reference, documentation on setting up table relationships (as well as other properties) in datasets can be found at https://msdn.microsoft.com/en-us/library/mt742155.aspx.

     

    Here is sample JSON for a dateset I used to test:

     

    {

    "name": "SampleData",

    "tables": [

    {

    "name": "TABLE_A",

    "columns": [

    { "name": "PRIMARY_KEY_A", "dataType": "string", "isHidden": "true" },

    { "name": "CUSTOMER_NAME", "dataType": "string" },

    { "name": "CUSTOMER_ID", "dataType": "Int64", "summarizeBy": "sum", "formatString": "#,##0;(#,##0)" },

    { "name": "SALES", "dataType": "Decimal", "summarizeBy": "sum", "formatString": "$#,##0;($#,##0)" }

    ]

    },

    {

    "name": "TABLE_B",

    "columns": [

    { "name": "FOREIGN_KEY_A", "dataType": "string", "isHidden": "true" },

    { "name": "CITY", "dataType": "string", "summarizeBy": "none" }

    ]

    }

    ],

    "relationships": [

    {

    "name": "TABLE_B_TABLE_A_REL",

    "crossFilteringBehavior": "BothDirections",

    "fromTable": "TABLE_B",

    "fromColumn": "FOREIGN_KEY_A",

    "toTable": "TABLE_A",

    "toColumn": "PRIMARY_KEY_A"

    }

    ]

    }