on 2023 Feb 05 8:59 PM
Hello together,
I have included an external service to my CAP project and added it to my service CDS. When I call the entity and use OData Notation $expand it is working, also the READ in my servicehandler is called.
I want to access the entity with $expand in a cds function ( https://cap.cloud.sap/docs/cds/cdl#actions ). What would be the right approach:
a) Use CQN SQL join ( https://cap.cloud.sap/docs/cds/cqn#select ) in my servicehandler
b) Create a new entity in my service CDS with mixin ( https://cap.cloud.sap/docs/cds/cql#query-local-mixins ) like described here https://answers.sap.com/questions/13055409/cap-using-expand-on-imported-model.html
c) Use await tx.get(url path with $expand)
c) is working for me, but maybe there is a better solution.
Thanks and best regards,
Julian
Request clarification before answering.
Hi @VoJu ,
I hope you found a solution already. I had luck with something like this in which masterBlockData is the master table and sma an association to another table.
SELECT.from('masterBlockData', (mbp) => {
mbp`.*`,
mbp.sma((sma) => {
sma`.*`;
});
}).limit(10)
I know its late but I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
25 | |
22 | |
8 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.