Add side effect of filling the fields of an address once we have a selection

This commit is contained in:
Elena Oresharova
2019-12-03 13:54:02 +01:00
parent 30b2854fac
commit 9e2c7a0974
2 changed files with 12 additions and 10 deletions

View File

@@ -30,6 +30,7 @@ annotate AdminService.Orders with {
SearchSupported: 'true',
Parameters: [
{ $Type: 'Common.ValueListParameterOut', LocalDataProperty: 'shippingAddress_AddressID', ValueListProperty: 'AddressID'},
{ $Type: 'Common.ValueListParameterDisplayOnly', ValueListProperty: 'PostalCode'},
{ $Type: 'Common.ValueListParameterDisplayOnly', ValueListProperty: 'CityName'},
{ $Type: 'Common.ValueListParameterDisplayOnly', ValueListProperty: 'StreetName'},
{ $Type: 'Common.ValueListParameterDisplayOnly', ValueListProperty: 'HouseNumber'},
@@ -96,15 +97,6 @@ annotate AdminService.Orders with @(
},
// TODO: Trigger side effects when `shippingAddress_AddressID` is changed
FieldGroup#ShippingAddress: {
Common.SideEffects : {
EffectTypes : #ValueChange,
SourceProperties : [shippingAddress_AddressID],
TargetProperties : [
shippingAddress.HouseNumber,
shippingAddress.StreetName,
shippingAddress.CityName
]
},
Data: [
{Value: shippingAddress_AddressID, Label:'{i18n>ShippingAddress}'},
{Value: shippingAddress.HouseNumber, Label:'{i18n>HouseNumber}'},
@@ -114,6 +106,16 @@ annotate AdminService.Orders with @(
]
},
},
Common.SideEffects : {
EffectTypes : #ValueChange,
SourceProperties : [shippingAddress_AddressID],
TargetProperties : [
shippingAddress.HouseNumber,
shippingAddress.StreetName,
shippingAddress.CityName,
shippingAddress.PostalCode
]
},
) {
createdAt @UI.HiddenFilter:false;
createdBy @UI.HiddenFilter:false;

View File

@@ -21,7 +21,7 @@ module.exports = db => {
PostalCode: '68789',
Country: 'Germany',
StreetName: 'SAP-Allee',
HouseNumber: '25',
HouseNumber: '25'
},
{
BusinessPartner: '1003765',