on 06-23-2021 10:47 AM
Hello,
In my CAP project I have added a custom action using extension points like here.
My intention is to collect the SelectedContext and then invoke an action that is defined at the service level. In oData v2, the ExtensionAPI has a method called invokeAction, but in oData v4 it doesn't exist.
Is there a way to call the action from the extension controller with oData v4?
Thanks.
Hello,
if the issue still exists:
invokeAction can be used since fall via the extension of the editFlow API of V4.
An easy example is available in the Fiori elements V4 feature showcase: GitHub - SAP-samples/fiori-elements-feature-showcase: Sample application that demonstrates and docum...
As stated in the documentation (API Reference - Demo Kit - SAPUI5 SDK (ondemand.com)) for unbound actions the model parameter is mandatory.
Best regards,
Marten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Marten,
i´m trying to invoke action, but parameters "skipParameterDialog" and also "parameterValues" are ignored. Am i doing something wrong ?
Its not CAP, but ABAP RAP, on-premise S4HANA, UI5 version 1.102.8", ODATA V4, action parameters done by CDS Abstract Entity.
Extension controller method:
test_function: function (oContext, aSelectedContexts) {
this.editFlow.invokeAction("com.sap.gateway.srvd.zre_vazby_hr_nj_osoba_vazba.v0001.zmenit_vazbu(com.sap.gateway.srvd.zre_vazby_hr_nj_osoba_vazba.v0001.VazbaType)", {
contexts: aSelectedContexts[0],
invocationGrouping: "Isolated",
label: "test",
parameterValues: [{ name: "VZTAH_OS", value: "UŽIVATEL" },
{ name: "CPRAC", value: "1" },
{ name: "begdat", value: "20221212" },
{ name: "enddat", value: "20221212" }
],
requiresNavigation: false,
skipParameterDialog: false
})
},
I done little bit research in UI5 library, but i think there is a constant for "showActionParameterDialog" instead of taking variable. Also in object "mParameters", array/map "parameterValues" is not passed to function "callBoundAction".
Is this a bug ?
callBoundAction scope, no array/map "parameterValues" in "mParameters"
Hi Marek,
please have a look at the respective API Documentation for 1.102.3: API Reference - Demo Kit - SAPUI5 SDK (ondemand.com)
The mentioned parameters were added in a newer release. With the latest S4 On-Prem Update, which should bump the UI5 Version to 1.108, you should be able to use them: API Reference - Demo Kit - SAPUI5 SDK (ondemand.com).
Best regards & Happy Holidays,
Marten
Hi 03e8435650854b0dbc2fe52f17eae075,
please consider bound actions, which are bound against the collection (Definition Language (CDL) | CAPire (cloud.sap)). Those behave like unbound actions on the UI, but with the distinction, that you still have an entity collection context and can use SideEffects.
{ $Type : 'UI.DataFieldForAction', Action : 'Service.action(Service.YourEntity)', Label : 'My bound collection action', },
Hope that already helps & BR,
Marten
User | Count |
---|---|
76 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.