new template
This commit is contained in:
@@ -45,7 +45,7 @@ annotate OrdersService.Orders with @(
|
|||||||
],
|
],
|
||||||
FieldGroup#Details: {
|
FieldGroup#Details: {
|
||||||
Data: [
|
Data: [
|
||||||
{Value: currency.code, Label:'Currency'}
|
{Value: currency_code, Label:'Currency'}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
FieldGroup#Created: {
|
FieldGroup#Created: {
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ namespace Z_bookshop.extension;
|
|||||||
// extend existing entity
|
// extend existing entity
|
||||||
extend orders.Orders with {
|
extend orders.Orders with {
|
||||||
Z_newField : String default 'Default Value';
|
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_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
|
// new entity - as association target
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ annotate OrdersService.Orders with @(
|
|||||||
LineItem: [
|
LineItem: [
|
||||||
{Value: OrderNo, Label:'OrderNo'},
|
{Value: OrderNo, Label:'OrderNo'},
|
||||||
{Value: Z_newField, Label:'New Field'}, // extension field
|
{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: Z_NewCodeList_code, Label:'New Code'}, // extension field
|
||||||
{Value: createdAt, Label:'Date'}
|
{Value: createdAt, Label:'Date'}
|
||||||
],
|
],
|
||||||
@@ -159,13 +159,13 @@ annotate OrdersService.Orders with @(
|
|||||||
Facets: [
|
Facets: [
|
||||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
|
{$Type: 'UI.ReferenceFacet', Label: '{i18n>Details}', Target: '@UI.FieldGroup#Details'},
|
||||||
{$Type: 'UI.ReferenceFacet', Label: '{i18n>OrderItems}', Target: 'Items/@UI.LineItem'},
|
{$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: {
|
FieldGroup#Details: {
|
||||||
Data: [
|
Data: [
|
||||||
{Value: currency_code, Label:'Currency'}, // correction
|
{Value: currency_code, Label:'Currency'},
|
||||||
{Value: Z_newField, Label:'New Field'}, // extension field
|
{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: 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'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user