How can I soft delete data from structure bounded to a toggle popup?
Application Type
Traditional Web

Hi all,

I want to soft delete data from the popup table which is bounded to a structurre.
Is there something I can get help from.
The functionality is on clicking merge button the chosen record through radio button should have the IsActive as True and IsDeleted as False and the other duplicate records having IsActive as False and IsDeleted as True should get soft deleted. I have attached the oml as well.

The soft delete functionality is the thing I want to know about.


Thank you,

Practice12j_.oml

mvp_badge
MVP
Solution

Did you try having a prameter hideDeleted to your page. and on button click set it to True.
Then in your filter you can add (not isDeleted and hideDeleted) or not hideDeleted

mvp_badge
MVP

Hi Wahaj,

If you already have the IsDeleted attribute then you are already soft deleting all you need to do then is in your aggregates add a filter that checks if IsDeleted is true.

A soft delete is not anything else than having a flag that you can use to hide the data (in your case IsDeleted)

Hi Eric,

Yeah you are right but the problem is that initially I need to show all the duplicate records on the pop up and then give a button to change the isactive. And in this button only i need to soft delete the other remaining records.
If I'll filter it by aggregate then the duplicate records having isactive false will not be displayed on the popup.

mvp_badge
MVP
Solution

Did you try having a prameter hideDeleted to your page. and on button click set it to True.
Then in your filter you can add (not isDeleted and hideDeleted) or not hideDeleted

Can you please elaborate this line:

"Did you try having a prameter hideDeleted to your page. and on button click set it to True. "


Thank you.

mvp_badge
MVP

Hi Wahaj,

on you page you can add the HideDeleted parameter

and then on click you set the HideDeleted parameter to true

All records are being hidden using this.

Hey @Wahaj Adil !

Have a look at my answer in this post that I tried to explain how to do soft delete with is Deleted variable.

https://www.outsystems.com/forums/discussion/75608/logic/

In your OML where is that logic that you're mentioning? where you want to soft delete?

Regards,

Márcio


mvp_badge
MVP

Hi Marcio,

Before answering a post based only on the title, please try to understand the question asked.
As you can read from his description he already implemented the soft delete.

And please read the other answers to get up to speed on what already has been discussed to avoid redundant answers

That's why I asked "In your OML where is that logic that you're mentioning? where do you want to soft delete?" ;) Maybe I didn't explain myself.

I want to see what is done and what can I help with my modest experience.

Please if you allow me to help Wahaj Adil, I will be very happy.

Cheers


mvp_badge
MVP

In your post you mention something he is already doing. Then referencing a post that describes what he already did.
He is already doing the soft delete, this question is about something else. Which you would have known if you would have read the discussion already going

So if we are going to read the description. He says:

  • "I want to soft delete data from the popup table which is bounded to a structure.
    Is there something I can get help from."
    • he wants help in something he doesn't know how to do
  • "The soft delete functionality is the thing I want to know about. "
    • It means that he doesn't have what he wants, that is soft delete

This next point can be there, but doesn't mean if @Wahaj Adil knows how to do or if what he is doing is right or not:

  • "The functionality is on clicking merge button the chosen record through radio button should have the IsActive as True and IsDeleted as False and the other duplicate records having IsActive as False and IsDeleted as True should get soft deleted. I have attached the oml as well."

After these points, I saw that he didn't know how to do a soft delete and I just gave him an example...

That's why I needed to share that information.

Please this is a meaningless discussion for nothing, there are worst cases, and I am not understanding. 

I have read everything even your answers and @Wahaj Adil 's answers and it didn't have anything that was saying that he already "knew how to do things ".

So please, if you want to talk please DM me and we can have a proper chat. I don't see a reason to continue to do this.

Regards,

Márcio



mvp_badge
MVP

If you would have read 1 post further, you would have seen my reply stating that he already has soft delete in place.
To which he reponds he understands, and explains what he actually means.
That is what I meant with read through the whole discussion.

Acrtually I want to change the IsActive , IsDeleted and also soft delete the data whch has IsDeleted as True/ISActive as True on the merge button.

mvp_badge
MVP

If I am understanding you correctly,
When opening the pop-up you want to see all duplicate records regardless of the isActive/isDeleted value.
Then on the click of "merge" you want to hide all duplicate records correct?

When they are "merged" and opening the popup again do you again want to see all records? or should the merged ones remain hidden?

You got me.

yes exactly, first all dup records should be displayed  and  the merged ones remain hidden after being merged.

Also a note to mention that merge function is also changing the values (IsActive/IsDeleted) and it also needs to hide the duplicate records only one record should be displayed.

mvp_badge
MVP

then always filter your aggregates on "not isDeleted" this will hide all soft deleted records.
Make sure isDeleted defaults to false.

Then on click of merge update the isDeleted of all duplicate records to true(skipping the first one, or at the end of the action updating one record's isDeleted back to false)

All dup records are being fetched but after merging no data is displayed.

mvp_badge
MVP

then probably all data has isDeleted = True or isActive = False

As shown in the screenshot one record has to be there with IsActive-=True and IsDeleted-=False. 

mvp_badge
MVP

can you send me a screenshot of your filters?

Can you please go through the oml!
I have too many aggregates and they have different filters along with list filters. 

mvp_badge
MVP

The origninal OML from your original post? I assume you have not implemented anything we have said until now there?

mvp_badge
MVP

Hi Wahaj,

If I were you, I would start over again with everything you have learned to see if you can get a less messy page. As this is to messy to read without having knowledge of the page

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.