Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Build Code Storyboard

T1mey
Participant
0 Kudos
799

Hello,

I have a CAP application with a draft enabled odata v4 service. In the storyboard under application logic I'm not able to create an event handler for the draft entity. (only for the entity itself)

T1mey_0-1724162230997.png

Anybody an idea ?

11 REPLIES 11

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
687

Hi @T1mey , from application logic (custom event handler) point of view, no distinguish on the draft entity or not, as both draft info and the committed entity data are shared in the same db entity table. And the corresponding app logic will get triggered when the draft entity standard events, such as READ, CREATE, etc.

Would you show more detail in which case the handler is not triggered as expected? thanks.

Regards,

Xin

0 Kudos
671

Basically I want to add a before "UPDATE" handler for my draft entity...

Should look at the end like this ... (added the expected code block by myself, this would get overridden as that file is generated)

T1mey_0-1724833501249.png

and in the wizard I can only select the entity, not the draft. 

T1mey_1-1724833716598.png

 

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
653

Thanks for the clarification, I got it now. In that case, no support yet from our application logic editor for this draft relevant entity.

As it's about Fiori UI specific scenario, I would like to know more what's the requirement for such draft entity handler? As I am not quite sure whether the existing abilities can do the same purpose, thanks.

639

So simple example... You have a dropdown on UI and if the selection changes you want to execute some logic...

T1mey_0-1724841344574.png

In that case you'll need to override the before UPDATE event handler for the draft entity.

xinye
Product and Topic Expert
Product and Topic Expert
631

Thanks, we will have further evaluation to see how to support this scenario from the application logic editor.

xinye
Product and Topic Expert
Product and Topic Expert
271

Update on this topic: the draft entity will soon be supported in the Application Logic Editor through a new dropdown option when adding new app logic. This feature is expected to be available in production around the end of November, thanks.

267

Great to hear !!! Thanks a lot, that makes it useable for us.

Looking forward to test it 😉

T1mey
Participant
0 Kudos
100

Hello @xinye ,

I realized that the storyboard now supports the draft entity handler creation. I was able to create my draft handlers, but somehow it disappeared again. 

Could you tell me when the draft dropdown entry is going to be displayed, based on which criteria?

And we realized a bug in the storyboard if a service has a namespace. (e.g. com.company.test)

T1mey_0-1733318074575.png

 

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
94

Hi @T1mey Sorry about the inconvenience, the latest release (including the application logic editor) was rolled back due to a compatible issue, it's assumed to be recovered soon. I can keep you updated once it's ready.

0 Kudos
87

Thanks a lot for the info @xinye . Any way to get the "new" version installed to be able to proceed with our development?

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
49

Hi @T1mey The new version will be available soon, no manual install required. Till then, would you go ahead with manual changes? However, please note to backup your manual changes to avoid the content is overridden triggered by the UI change within Application Logic Editor.