I try do do a DB project with SAP cap. I want to display all entities associated with the Parent entity. If the Association is one to one it works fine. But if it is one to many it doesn't display anything.
--I have following Schema definition:
entity Company{
key ID : Integer @title: 'Company ID';
cName : String @title: 'Company name';
pers: Association to many Person on pers.comp = $self; //association to one works
}
entity Person{
key ID : Integer @title: 'ID';
pName: String @titel: 'Name';
comp: Association to Company;
}
--And following fiori Annotations:
annotate Admin.Company with @(
UI.LineItem:[
{$Type: 'UI.DataField', Value: cName},
],
UI.HeaderInfo:{
TypeName: 'Company',
TypeNamePlural: 'Companys'
},
);
//Details view:
annotate Admin.Company with @(
UI: {
HeaderInfo: {
Description: {Value: ID}
},
HeaderFacets: [
{$Type: 'UI.ReferenceFacet', Target: '@UI.FieldGroup#Comp'},
],
Facets: [
{$Type: 'UI.ReferenceFacet', Target: '@UI.FieldGroup#Pers'}
],
FieldGroup#Comp: {
Data: [
{Value: cName},
]
},
FieldGroup#Pers: {
Data: [
{Value: pers.pName},
]
},
});
The Admin Service is just a projection on the given entities.
Does anyone know what I have to change to get pers.Name displayed in a list or something like that?
As already mentioned if I change in Schema definition 'association to many' into 'association to one' it works. But I want it to have more than one entity associated.