user delete in outsystems environments

Sudip Dey

Jorge Martins

how i can delete the user in outsytems

sharing with demo file, please


Hi Hafiz,

Check the attached oml.

You just need to use user entity action "DeleteUser".

I have shared an oml ,where I gave a button to delete individual user. However you can also give a checkbox on the list to delete multiple users in a single click. user for each loop in the action to check if user is selected and delete it. Hope it helps.

If you used UserId in another table  and delete rule is "protect", then make sure to remove the records from that another table and then from user table.

Regards

Seema

Hi Hafiz,

You can call the DeleteUser action from the User Entity and pass Id of the user you want to delete. Thats it, it is so simple.

Using the DeleteUser Action can not be so easy to use at all in real-life. If you reference this User Identity in other tables and the deletion rule is set to Protect than the user will not be deleted and an error will be thrown. To be able to delete the user in this case you will first need to remove all references to this user in all other tables/applications. This can be a time consuming issue if you don't know exactly where a reference is being used.

As an alternative (and one that we are using ourselves) is not deleting a user at all since this can cause data incompleteness in our applications, why not simply disable the user by setting the Is_Active property to False? That way the user can't logon anymore, and also important, isn't counted against the "OutSystems available user licenses" and thereby freeing up a license. You can now also hide that user for all kind of lists.

Solution

please check the screens and it will be from the Users modules. login to your user's module and do the 3 steps if you want to delete it Manually.

I hope this will help you. 

Thank you,

Sudip


Solution

If you want to Delete from your Application, Then the suggestion of the Seema is the best solution. Otherwise, it can be from the Users module.

Thank you,

Sudip

Hi Hafiz,

Few things i wanted to add here.

1. Every entity has a delete action associate with it , user entity is also same as other entities and has that action with it and thus the action can be used directly.

2.Usually in case of users it is best practice to do the soft delete (marking user as inactive ) rather deleting him permanently. This will help you in auditing in future.

3.Even after all if you want to delete the user make sure that you delete relative data from other entities as well where you exposed UserId as foreign key.

Also for better understanding please give better context of your problem , like what you are trying to do and what problem you are facing doing the same to give better solution.


Regards,

-PJ-