How to delete this users?

Hello Community,

I'm trying to delete the unused users, So I am getting this exception message can you please help me to delete this users

Thankyou


Solution

Adding another note. When you want to avoid this, you need to change the delete rule of UserId to delete or ignore on the employee table, when you delete a User you will not get that error. Sometimes is bad to do that, other times is ok, it depends on what you want to do and how.

Regards,

Márcio C.

mvp_badge
MVP

Or to Ignore, depending on what you want.

When the subject is Users, is safer to ignore :)

Yes, I agree, I forgot to mention that. I was in a rage moment because of that error, it happened a lot of times before with me :D

mvp_badge
MVP

Indeed, also because of the huge performance impact it can have (imagine having a 1000 entities all with a "CreatedBy" or "ModifiedBy", and that user having 10,000s of records associated...).

Thankyou Marcio.

Welcome!! :)

Choose wisely if you want to maintain the data(using the ignore rule) or delete all the data(delete rule) that have the userId associated.

Regards,

M´árcio C.

Hi Ritesh,

that UserId is being used on Employee entity. Please check the full error on Service Center.


Hi @Ritesh Ghate 

As @José Gonçalves said that user is being used on the Employee entity, so you need to delete first the employee with that user Id and then you are able to delete the user.


Regards

Gonçalo Almeida

Solution

Adding another note. When you want to avoid this, you need to change the delete rule of UserId to delete or ignore on the employee table, when you delete a User you will not get that error. Sometimes is bad to do that, other times is ok, it depends on what you want to do and how.

Regards,

Márcio C.

mvp_badge
MVP

Or to Ignore, depending on what you want.

When the subject is Users, is safer to ignore :)

Yes, I agree, I forgot to mention that. I was in a rage moment because of that error, it happened a lot of times before with me :D

mvp_badge
MVP

Indeed, also because of the huge performance impact it can have (imagine having a 1000 entities all with a "CreatedBy" or "ModifiedBy", and that user having 10,000s of records associated...).

Thankyou Marcio.

Welcome!! :)

Choose wisely if you want to maintain the data(using the ignore rule) or delete all the data(delete rule) that have the userId associated.

Regards,

M´árcio C.

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