238
Views
11
Comments
Solved
Adding a Delete Button Function
Application Type
Reactive
Service Studio Version
11.54.54 (Build 63219)

Hello, I'm a beginner in OutSystems.
Currently developing an app to display daily staff leaves, where the staff can update their leave dates and leave types. For now I am able to create a feature where staff can add/edit their leaves, staff can also sort out the dates they wish to view other leaves... but I am having a problem to add the 'delete' button.
My question is, should I create a new static entity and records specifically for the use in the 'Delete' button so that whenever user clicks it, it only deletes the specific chosen of row in the table?

ihatethis(update).oml
2023-01-11 14-38-58
TESI-Sherwin
Solution

Hi Aniq Idris Ahmad 

I think the database integrity issue is not related to the question so please update if the question is answered/fixed.



to answer the database integrity warning. 

In some scenarios when you rename an attribute on a table and doing that, will create a new attribute on the database(renamed attribute) and retain the original attribute name in the database(not visible on Service Studio).

to solve this you, just need to re-add the original attribute with the original name and then publish and the warning will be removed.

take note that the original values on that original attribute will remain.


for more accurate instruction, here's a sample GIF.


Furthermore i think this should answer your existing question

https://www.outsystems.com/forums/discussion/96280/database-integrity-suggestion-problem/

GIF 00-30 05 April 2024.gif
2024-04-26 12-21-07
Anjali_Dange
Solution

Hi Aniq,

You can achieve delete functionality by grouping by id of GetStaffleavedates2024Grouped aggregate  and passing it to Entity delete action through DeleteOnClick client action.

I have attached the updated oml file. Hope this helps.


Thanks & Regards,

Anjali


ihatethis(update).oml
UserImage.jpg
Aniq Idris

thank so much Anjali for the help! 
there's another thing which bothers me...
how do i fix this particular thing?
'Database Integrity Suggestion'


2023-01-11 14-38-58
TESI-Sherwin
Solution

Hi Aniq Idris Ahmad 

I think the database integrity issue is not related to the question so please update if the question is answered/fixed.



to answer the database integrity warning. 

In some scenarios when you rename an attribute on a table and doing that, will create a new attribute on the database(renamed attribute) and retain the original attribute name in the database(not visible on Service Studio).

to solve this you, just need to re-add the original attribute with the original name and then publish and the warning will be removed.

take note that the original values on that original attribute will remain.


for more accurate instruction, here's a sample GIF.


Furthermore i think this should answer your existing question

https://www.outsystems.com/forums/discussion/96280/database-integrity-suggestion-problem/

GIF 00-30 05 April 2024.gif
2024-03-22 09-17-23
Chandra Vikas Sharma

Hi Aniq,

I downloaded your OML and found the current logic is correct and it's delete specific row of grid . I think no need to  new static entity and records .

if any other requirement which i not understand then please let me know

Thanks

CV

UserImage.jpg
Aniq Idris

but if i click the delete button as of currently, it deletes the whole record of user's name...

I only wish to delete the specific chosen date of user's leave application, not it's whole record of leaves

2025-11-17 13-04-58
Joni Vähäkuopus

Hello!

You need to add new input parameter with data type of StaffLeaveDates2024 Identifier to DeleteUserLeave action, use that input in database delete action and assign current StaffLeaveDates2024.Id from table data to this new input parameter in DeleteUserLeave action. You need to add this StaffLeaveDates2024.Id to your grouping in order to do that. 

Hope this helps!  

UserImage.jpg
Aniq Idris

it's not working... I think I might did something wrong. Would you please see what it is?

2025-11-17 13-04-58
Joni Vähäkuopus

Could you send me the OML, with these new changes you tried? I can take a look.

2025-11-17 13-04-58
Joni Vähäkuopus

Check Anjali's answer below, it's exactly the same solution what I tried to explain earlier. 

UserImage.jpg
Aniq Idris

alright thank you for the help, i appreciate it!

2024-04-26 12-21-07
Anjali_Dange
Solution

Hi Aniq,

You can achieve delete functionality by grouping by id of GetStaffleavedates2024Grouped aggregate  and passing it to Entity delete action through DeleteOnClick client action.

I have attached the updated oml file. Hope this helps.


Thanks & Regards,

Anjali


ihatethis(update).oml
UserImage.jpg
Aniq Idris

thank so much Anjali for the help! 
there's another thing which bothers me...
how do i fix this particular thing?
'Database Integrity Suggestion'


2023-01-11 14-38-58
TESI-Sherwin
Solution

Hi Aniq Idris Ahmad 

I think the database integrity issue is not related to the question so please update if the question is answered/fixed.



to answer the database integrity warning. 

In some scenarios when you rename an attribute on a table and doing that, will create a new attribute on the database(renamed attribute) and retain the original attribute name in the database(not visible on Service Studio).

to solve this you, just need to re-add the original attribute with the original name and then publish and the warning will be removed.

take note that the original values on that original attribute will remain.


for more accurate instruction, here's a sample GIF.


Furthermore i think this should answer your existing question

https://www.outsystems.com/forums/discussion/96280/database-integrity-suggestion-problem/

GIF 00-30 05 April 2024.gif
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.