Deleting all users of an app

Deleting all users of an app

  
Hi There,

I have a question, I want to delete all the users of the application Ecommerce wich I installed.
I deleted the espace, but that wasn't enough so I added it again, but now I have instead of 181 users, 269 users.

How can I delete all the users of this app?

Thanks in advance!

With kind regards,
Daan

I made an application that shows all the users, with a delete button.
But when I try to delete them I get a error:



I think this error is because all the users that I have in my list are active.
Thats why I marked a few of the users as inactive, but those won't show up in my record list.
Whatever I try they don't show.

Is there a way to show those Users that are inactive?

Edit: Correction, when a user is inactive and I delete them I get the same error.

Edit: I can delete users I created myself, However I can't delete users from outsystems.
Hi Daan,

The error seems to indicate that either now (or at some point) you had BPM activities running that were assigned to one of the users. It may even be the case that the activity was created by the seed data of one of our ready-made apps.

You could start by doing an update to the Activity entity and setting the User_Id there to NullIdentifier and then re-try to delete the Users.

Not sure if you're not going to hit some other foreign key... but it may be worth trying.

Cheers,


Miguel
Hi Miguel,

What do  you mean with the activity entity and the user_Id updating with the NullIdentifier?
I am not able to change anything in the entity of the user, it is all protected against changing.
Daan wrote:
Hi Miguel,

What do  you mean with the activity entity and the user_Id updating with the NullIdentifier?
I am not able to change anything in the entity of the user, it is all protected against changing.
 
 hi daan

you wont be able to change the user_id to null in the users table
as the primary key wouldnt be unique anymore

the problem you are having, is because there are other tables
which have records referencing to one or several of your users

so you need to either delete the user AND all referencing records in the other tables
or go through all other tables (not the users table) and change the user_id to null (or a dummy user, that you wont delete)
then you can delete every user, that is not referenced in an other table record

the reason for all this is the "protected" setting, that can set in the field properties
which is good (keeps everything clean), but can also require a little more work
 
 Hi Manuel,

I have been going through alot of users and set them as inactive.
Isn't it that when its set to inactive all other records of this user will dissappear out of the applications?

The problem how ever is that I can't delete a inactive user, and I am not able to find them in the ecommerce role of the users table.
So for my opinion they aren't connected with anything, however they still aren't deletable.

It could be that I don't understand you right, but I think I deleted all the connections of the users.
try right-clicking on the user table, then click find usages
scroll through the list, to where element sais "Entity Attribute" or reference

thats all the tables where the userid is used - did you check all those?
the userid's that you want to delete, must first be removed/replaced in all those tables
(dont change the entities, only the data thats in them)

PS: setting a user to inactive, is usually done with a flag in the table
which then deactivates certain functionalities in the application.
but the user is still there for the database.
which is usually desired, to maintain log's and other application functionalities etc
Hi Manuel,

I tried to find the entity attribute but that one is not in the list.
When I click on the user table and click on find usages I get:
- Query
- For each
- If
- Execute Action
- Refresh query
- Execute action
- Refresh query
- Web block widget
- Web block widget
- Table Records
- check box
- Link
- Link
- Link
- Expression
- Expression
- Link
- Link
- Expression
- Expression
- Expression
- Expression
- If
- Web block widget
- Web block widget

There is no entity attribute in this list, wich one should I take then?
Hi Daan,

I believe Manuel meant "Find Usages in all eSpaces" (over the entity). That will open every consumer of that entity in SS.

Regards,


Miguel
Hi Miguel,

I can't select "find usages in all espaces" on the users, I use my own app to even be able to try to change something.
I am not able to open the normal Users app from outsystems in my service center (probably locked)

But I can only do find usages on the user table, I get new stuff now like Query entity but still no entity attribute.