Application Development and Automation 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: 
Read only

SAP Build Code Storyboard

T1mey
Active Participant
0 Kudos
2,418

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 ?

13 REPLIES 13
Read only

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
2,306

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

Read only

T1mey
Active Participant
0 Kudos
2,290

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

 

Read only

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
2,272

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.

Read only

T1mey
Active Participant
2,258

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.

Read only

xinye
Product and Topic Expert
Product and Topic Expert
2,250

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

Read only

xinye
Product and Topic Expert
Product and Topic Expert
1,890

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.

Read only

T1mey
Active Participant
1,886

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

Looking forward to test it 😉

Read only

T1mey
Active Participant
0 Kudos
1,719

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

 

Read only

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,713

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.

Read only

T1mey
Active Participant
0 Kudos
1,706

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

Read only

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,668

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.

Read only

T1mey
Active Participant
0 Kudos
1,614

Hi @xinye ,

may I ask another question... if we wanna implement an error event handler.

this.on("error", (err, req) => { ... }

How can this be achieved using storyboard and app logic editor.

Read only

xinye
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,575

Hi @T1mey , FYI, the latest application logic editor has been available in production.

Regarding your question on `error` event handler, it's not supported yet from LCAP app logic editor, it could only be done manually, but please avoid the content to be overwritten by the app logic editor.

In addition, would you mind listing the missing handlers here (or send me email xin.ye@sap.com)? so that we can take them into account for our improvement, thanks.