on ‎2022 Aug 26 10:26 PM
In a post that I recently wrote (https://answers.sap.com/questions/13710082/invoke-cap-cds-function-from-sap-fiori-element-ext.html?url_id=text-global-profile-inbox-qa-answer-published-to-question), a question has arisen that I have not been able to clarify in the comments and that I have decided to raise in a separate publication. It is precisely what I outline in the title of this post.
I am writing an SAP CAP + SAP Fiori Elements app, and I want to put, in my UI, a button that invokes/calls a CDS function (not an Action) defined in my CAP services.
From the examples I've seen, and from the responses I received in the post I quoted earlier, it is indicated to use annotations like the following:
{
$Type : 'UI.DataFieldForAction',
Action : 'AdminService.EntityContainer/sendmail', // --->> would it work if sendmail was a function?
Label : '{i18n>sendmail}'
},
However, here is my specific question: Does this work for CDS functions (ie sendmail was a function and not an action)?
Request clarification before answering.
Hi Isaac,
I think you need to file an incident via SAP Support on this topic. The documentation for DataFieldForAction defines for the Action: "Qualified name of an Action, Function, ActionImport or FunctionImport in scope". So a function should also be supported. I've tried in my sample project and added an function to my Orders Entity:
Interresting thing is that this function isn't invoked when using SAPUI5 1.96. But it works when using SAPUI5 1.105.0. But there only with OData V2.
So I suggest you file an incident via SAP support providing my sample.
Best Regards
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 7 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.