Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[CAP] Fiori Elements – SideEffects for actions

If you add a custom button in Fiori Elements to trigger an action (like described here), it can be necessary to reload after execution.

When having the following cds model (including a bound and an unbound action)

entity MyEntity as projection on my.Entity
        actions {
            action approval();
        };

action createMyEntity(description: String) returns Entity;

you can either trigger the whole entity to reload

# unbound
annotate myService.createMyEntity with
  @Common.SideEffects: {
    TargetEntities: ['/myService.EntityContainer/MyEntity']
  };

or just some specific fields

# bound
annotate myService.MyEntity.actions {
    approval @(Common.SideEffects: {TargetProperties: [
        'in/status',
        'in/modifiedBy',
        'in/modfiedOn',
    ]})
};

Leave a Reply

Your email address will not be published. Required fields are marked *