diff --git a/multitenancy/app/orders/fiori-service.cds b/multitenancy/app/orders/fiori-service.cds index e58c8ccd..ed0b79c0 100644 --- a/multitenancy/app/orders/fiori-service.cds +++ b/multitenancy/app/orders/fiori-service.cds @@ -45,7 +45,7 @@ annotate OrdersService.Orders with @( ], FieldGroup#Details: { Data: [ - {Value: currency.code, Label:'Currency'} + {Value: currency_code, Label:'Currency'} ] }, FieldGroup#Created: { diff --git a/multitenancy/tpl/db/extension.cds b/multitenancy/tpl/db/extension.cds index 674112b5..28dca055 100644 --- a/multitenancy/tpl/db/extension.cds +++ b/multitenancy/tpl/db/extension.cds @@ -12,9 +12,9 @@ namespace Z_bookshop.extension; // extend existing entity extend orders.Orders with { Z_newField : String default 'Default Value'; - Z_NewAssociation : Association to one Z_NewEntity; + Z_NewEntity : Association to one Z_NewEntity; Z_NewCodeList : Association to one Z_NewCodeList; - Z_NewComposition : Composition of many Z_NewCompEntity on Z_NewComposition.parent = $self; + Z_NewCompEntity : Composition of many Z_NewCompEntity on Z_NewCompEntity.parent = $self; } // new entity - as association target diff --git a/multitenancy/tpl/srv/extension_service_ui.cds b/multitenancy/tpl/srv/extension_service_ui.cds index 3ebda9c7..c0c0dff9 100644 --- a/multitenancy/tpl/srv/extension_service_ui.cds +++ b/multitenancy/tpl/srv/extension_service_ui.cds @@ -135,7 +135,7 @@ annotate OrdersService.Orders with @( LineItem: [ {Value: OrderNo, Label:'OrderNo'}, {Value: Z_newField, Label:'New Field'}, // extension field - {Value: Z_NewAssociation_ID, Label:'New Association'}, // extension field + {Value: Z_NewEntity_ID, Label:'New Entity'}, // extension field {Value: Z_NewCodeList_code, Label:'New Code'}, // extension field {Value: createdAt, Label:'Date'} ], @@ -159,13 +159,13 @@ annotate OrdersService.Orders with @( Facets: [ {$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'}, {$Type: 'UI.ReferenceFacet', Label: '{i18n>OrderItems}', Target: 'Items/@UI.LineItem'}, - {$Type: 'UI.ReferenceFacet', Label: 'New Composition', Target: 'Z_NewComposition/@UI.LineItem'} // new composition + {$Type: 'UI.ReferenceFacet', Label: 'New Composition', Target: 'Z_NewCompEntity/@UI.LineItem'} // new composition ], FieldGroup#Details: { Data: [ - {Value: currency_code, Label:'Currency'}, // correction - {Value: Z_newField, Label:'New Field'}, // extension field - {Value: Z_NewAssociation_ID, Label:'New Association'}, // extension field + {Value: currency_code, Label:'Currency'}, + {Value: Z_newField, Label:'New Field'}, // extension field + {Value: Z_NewEntity_ID, Label:'New Entity'}, // extension field {Value: Z_NewCodeList_code, Label:'New Code'}, // extension field ] }, @@ -184,4 +184,25 @@ annotate OrdersService.Orders with @( }, ) ; - +// new field in existing service -- exchange ID with text + annotate OrdersService.Orders with { + Z_NewEntity @( + Common: { + //show description, not id for New Entity in the context of Orders + Text: Z_NewEntity.description , TextArrangement: #TextOnly, + ValueList: { + Label: 'New Entity', + CollectionPath: 'Z_NewEntity', + Parameters: [ + { $Type: 'Common.ValueListParameterInOut', + LocalDataProperty: Z_NewEntity_ID, + ValueListProperty: 'ID' + }, + { $Type: 'Common.ValueListParameterDisplayOnly', + ValueListProperty: 'description' + } + ] + } + } + ); +} \ No newline at end of file