How to delete the data from User Entity

I've tried using a server action which includes  SQL to delete the data using the query but it throws an error saying "The DELETE statement conflicted with the REFERENCE constraint "


Hi Mamini,

This means that you have another entity that has a Foreign Key pointing to this entity with data. So you need to change the DELETE rule of that Foreign Key to DELETE or delete data from THAT entity BEFORE deleting the data in the parent entity.

EDIT: In the case of User entity, there are system entities that also point to it. Traditional way is just to disable the user (set IsActive field to False).