question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expand on draft enabled entity

See original GitHub issue

Hi,

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: image

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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vkozyuracommented, Jul 9, 2020

@sbarzaghialteaup: We implemented navigation using association from draft to active entity. Fix to be provided with the next release.

1reaction
johannes-vogelcommented, Jun 8, 2020

@sbarzaghialteaup Please bear with us. We are working on it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found