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?
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/
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
thank so much Anjali for the help! there's another thing which bothers me...how do i fix this particular thing?'Database Integrity Suggestion'
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
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
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!
it's not working... I think I might did something wrong. Would you please see what it is?
Could you send me the OML, with these new changes you tried? I can take a look.
Check Anjali's answer below, it's exactly the same solution what I tried to explain earlier.
alright thank you for the help, i appreciate it!