Skip to Content
Feb 28, 2022 at 09:48 AM

Update List report value on Action button click

312 Views Last edit Feb 28, 2022 at 09:52 AM 4 rev

Dear Experts,

I have a Fiori Elements list report with a custom action button called release. When the button release is pressed, the status of values of one of the columns should get changed from 20 to 30. I have added the button using the extension feature of Fiori elements. I have seen the below blog

Fiori Elements List – Add and Implement Action Button | SAP Blogs regarding the action button and its operations using BOPF. But I would like to do it using extension controller.js. How can i update the list report data after the button is pressed? Below is the code.

sap.ui.define([],function ()

{ "use strict"; return

{ but_release: function(oEvent)

{ var oModel = this.getView().getModel(); let aContexts = this.extensionAPI.getSelectedContexts();

aContexts.forEach(element => { let data = element.getModel().getObject(element.getPath());

if (data.Status = 60)

{ oModel.setProperty("Status", "20");

} }); } };});