on 07-13-2021 11:20 AM
I think, I have seen this question before, but just cant find the answer.
What I'd like is an after-read method that computes a value for a field. I can easily place it in after-read of that entity in the service implementation. that works for service calls like
/EntityWithComputedProp
What I would like, though, is a method that will be executed regardless of how the service was called, e.g.
/SomeOtherEntity?$expand=EntityWithComputedProp
If I recall correctly, there is a way to do that. (except placing similar code in after-read of SomeOtherEntity)
Thanks, Sergei
does the example at https://github.com/sapmentors/cap-community/tree/main/examples/computed-field help?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please check if this approach helps: https://answers.sap.com/comments/13324496/view.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, I was hoping to avoid exactly that. Sure I would extract the actual code to a method, but having a lot of associations to that entity from various places, I would need to call that everywhere.
I think, there was a post (cant find it) pointing out how to add an after-read handler of the DB entity rather than an after-read of the Service-Entity...
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.