Greetings, community experts.
I am developing a CAP application (OData V4), with SAP Fiori Element for the UI, on SAP BTP.
The issue is that, although the action is running correctly, the corresponding Side Effects are not working.
My Custom Action defines a button in the header of an Object Page, which invokes a Bounded Action in my CAP service. The corresponding Side Effect must update a text label in the same header.
Definition of Bounded Action (CDS):
actions {
function existePDF() returns RespExistArch;
function existeXML() returns RespExistArch;
@(cds.odata.bindingparameter.name: '_it',
Common.SideEffects: {
TargetProperties: ['_it/estatRevision', '_it/textRevision', '_it/criticalidadRevision']
})
action ponerEstatusRevisado();
};
JavaScript function in the extension controller, which invokes the Action:
sap.ui.define([
"sap/m/MessageToast",
"sap/m/BusyDialog",
"sacep/m/MessageBox",
"sap/m/PDFViewer",
"sap/ui/core/library"],
function(MessageToast, BusyDialog, MessageBox, PDFViewer, coreLibrary) {
'use strict';
return {
actualizarEstatus: function(oEvent) {
let sActionName = "AdminSrv.ponerEstatusRevisado()";
let oParameters = {
contexts: oEvent.oBinding, //getSource().getBindingContext(),
model: oEvent.oModel, //getSource().getModel(),
label: 'Confirm',
invocationGrouping: true
};
this.editFlow.invokeAction(sActionName, oParameters).then(function(reslt) {
console.log("SUCCESS");
//reslt.oBinding.refresh();
}).catch(function(err) {
console.log("ERROR: ", err);
});
},
};
});
As you can see, I have changed the values for the contexts and model fields, since the getSource() function returns undefined (the function does not exist in the oEvent object). I don't know if that change I made is the cause of the problem.
For now, for the changes to be visible in the Object Page header, the page must be refreshed manually.
In advance, thanks for any help and/or suggestions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.