Expand on draft enabled entity
See original GitHub issueHi,
I have a problem using TextArrangement if the associated entity is draft enabled.
Scenario:
@odata.draft.enabled
@cds.odata.valuelist
entity Servers
name : String
@odata.draft.enabled
entity Systems
name : String
@Common : {
Text : server.name,
TextArrangement : #TextOnly
}
server : Association to Servers;
I edit the “Systems” entity with Fiori then I use the value help on the “server” field, when I close the value help I get the ID instead of the name:
Investigating I found that the get on the “Systems” draft entity returns null in the expand:
GET {{server}}/services/Systems(ID=9e1dde5c-9ddb-4700-9dc9-a5108d7150d2,IsActiveEntity=false)?
&$select=server
&$expand=server($select=name)
{
"@odata.context": "$metadata#Systems(server,ID,IsActiveEntity,server(hostname,ID,IsActiveEntity))/$entity",
"ID": "9e1dde5c-9ddb-4700-9dc9-a5108d7150d2",
"IsActiveEntity": false,
"server": null
}
If I remove the draft annotation on the “Servers” entity there is no the problem. If I create a draft version of the “Server” entity I don’t have the problem. Seems that the expand is trying to read the draft version of the “Servers” entity.
This repository shows the problem: https://github.com/sbarzaghialteaup/cap_test_draft
Thanks and Best Regards
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Issue with $expand in nodejs CAP application with @odata ...
Hi, We are having the following issues with entities annotated with @odata.draft.enabled in our CAP nodejs application.
Read more >Serving Fiori UIs - SAP Capire
To enable draft for an entity exposed by a service, simply annotate it with @odata.draft.enabled as in this example: annotate AdminService.Books with @ ......
Read more >Draft Handling - Documentation - Demo Kit - SAPUI5 SDK
When a user starts creating a new business entity or edits an existing one, a draft is created in the background. This enables...
Read more >Build Purchase Order Draft Enabled Fiori Elements ... - YouTube
Build End to End Fiori Element Application on Cloud Application Programming Model CAPM with Business Application Studio How to Create Fiori ...
Read more >Patch Call For Odata.Draft.Enabled Entity Returns 404
When users edit a draft-enabled entity in the frontend, the following requests are sent to the CAP Java backend. That means, either a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sbarzaghialteaup: We implemented navigation using association from draft to active entity. Fix to be provided with the next release.
@sbarzaghialteaup Please bear with us. We are working on it.