cancel
Showing results for 
Search instead for 
Did you mean: 

Enable the action buttons in sap fiori worklist application

shil123
Participant
0 Kudos

Hello all,

I am using sap fiori element worklist template to create my app, there I need to add action buttons, I have added the action buttons but those action buttons are disabled and I want to enable it using cap UI annotations.

Could anyone please help me on this.

the below is the code I am writing for the action buttons and I want to enable that delete button.{ $Type : 'UI.DataFieldForAction', Label : 'Raise Resignation', ![@UI.IsCopyAction] : true, },{ $Type : 'UI.DataFieldForAction', Label : 'Cancel' }
View Entire Topic
Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi shil123,

I was under the impression that such buttons would only be enabled if you had a line selected on the table below.

On your screen capture, I don't see any records being loaded. Hence the buttons aren't enabled (default behavior).

Please check the following blog:

https://blogs.sap.com/2022/12/23/cap-with-fiori-elements-side-effects-custom-actions-dynamic-express...

Or this one:

https://blogs.sap.com/2020/09/22/controlling-cap-actions-on-fiori-ui/

Best regards,
Ivan

shil123
Participant
0 Kudos

Hello ivan.mirisola,

Is it possible to enable the button without selecting the line items that is as soon as the list report is loaded the button has to be in the enabled?

Thanks in advance.

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi shil123,

I don't think that's how it works. The framework would have to know to which record the action is going to be performed against. So, no row selected, no actions available.

The worklist concept has a filter bar and a table with contents. First step is to perform a search and then the next action would be either a custom action based on a row in the table or the user will be directed to a page with detailed information on the selected row (click on the row should open that record with additional information on a separate screen).

With that in mind, you either should be thinking of using another template in which you can add buttons or actions that are independent of table row selection or you could implement that action inside the details page (which in essence would be the same as selecting the row before being able to click on the action).

Hope this clarifies. If not, could you please detail the business process you are trying to implement in Fiori so we can better indicate you other approaches to your challenge?

Best regards,
Ivan

shil123
Participant
0 Kudos

Hello ivan.mirisola

Is it possible to hide/unhide the action buttons in the list report table header page based on conditions, like if an employee have already raised the resignation, the raise resignation action button has to be hidden for that particular person?

Thanks in advance.

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi shil123,

I still don't quite understand the business requirement. If the user has already submitted an 'action' to one of the table's records to the back-end service, then the table's results should change accordingly. Thus, it would make sense that the previous record wouldn't even be there for another 'action' to take place. It would mean that a choice was made. Thus, the worklist no longer needs to display that particular record to the user.

I still think this worklist template doesn't work for your particular "use-case". But, to better help, we would really benefit if you could detail a little more the business process you are trying to solve.

IMHO: If the user simply needs to submit a resignation, then a simple form would suffice. The user would fill out a couple of fields and that would be fed to an OData service which would create a resignation record containing the dates, ids and status, Then you could display a list of resignations records to that user or to his manager. Here, I don't see the need for an 'actions' to be performed on a record in the list.

But then again, I need more context to propose a better approach to your business process.

Best regards,
Ivan

shil123
Participant
0 Kudos

Hi ivan.mirisola,

The person who have raised the resignation list has to be present in the table because if the user wants to see/modify the data particular resignation, list data has to be present so that user can see/modify the data.

So in this scenario the resignation have already been raised and now the raise resignation button has to be disabled.

Thanks in advance.

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi shil123,

You are assuming I understand the term 'resignation' and how the business process that relates to it works - which I don't really know.

Could you please explain in simple terms (for dummies), what is the business process you are trying to implement - please disregard which technology you chose and how you are thinking of implementing it. Just keep it in simple terms what is the business process and then we can move on how it could work in terms of technology being used and how to implement it.

Best regards,
Ivan