progress / JSDO

Client side TypeScript library to access Progress® Data Object Services
Other
23 stars 27 forks source link

Working with a Catalog offering nested tables #275

Open W1nstar opened 4 years ago

W1nstar commented 4 years ago

Hello again,

I'm trying to read, using the .fill() function, and then sort and generally work with a catalog offering 3 tables, two nested to one of them.

My guess was that reading the first table would return data from the other two, something like

table1: [
    {code: 1, 
    table2: [{codeB: 1}, {codeB: 2}],
    table3: [{codeC:1}, {codeC:2}]
    },
    {code: 2, 
    table2: [{codeB: 3}, {codeB: 4}],
    table3: [{codeC:5}, {codeC:6}]
    }
]

But I'm forced to specify a tableRef on the paramObj used by fill, and in doing so the server only returns records from the tableRef I'm specifying. Plus, the server then returns only data about the first table.

Is this a wrong approach? Isn't this possible, or I'm doing something wrong? It's key for the project to be able to consume Business Entities like this one.

Edit: this may be an error on the catalog? table1 has a _children.length of 0, and no relationships.

rwdroge commented 4 years ago

I think the dataset in a JSDO can ony have one table reference:

https://knowledgebase.progress.com/articles/Article/Using-a-dataset-in-a-jsdo-as-a-parameter-to-an-invoke-method

W1nstar commented 4 years ago

I think the dataset in a JSDO can ony have one table reference:

https://knowledgebase.progress.com/articles/Article/Using-a-dataset-in-a-jsdo-as-a-parameter-to-an-invoke-method

Yeah, but I'm talking about a simple .fill() operation, not an invoke. I'll edit that in the question.