Hi,
i've been working with CDS, and know I found this problem...it must be something i'm missing...
I have this declared in the hdbdd file:
@Catalog.tableType: #COLUMN
Entity language {
key code: String(2) not null;
name: Association to model.interface_text { string_id } not null;
};
@Catalog.tableType: #COLUMN
Entity user {
key id: Integer64 not null;
language_code: Association to model.language { code };
}
The point is that if I access the association like this:
language_code: results[i].language_code
That shows this:
"language_code": {
"name": {
"string_id": "english_id"
},
"code": "en"
},
But if i just want to access the code, i've tried some ways:
language_code: results[i].language_code.code
language_code: results[i].language_code["code"]
But that shows up this error:
TypeError: results[i].language_code is undefined
If I try it this way:
language_code: results[i].language_code[code]
Another error is given:
ReferenceError: code is not defined
And if i try this way:
language_code: results[i]["language_code.code"],
Nothing shows up...
What am I doing wrong??
Best regards,
Luis.