+ Start a Discussion
Rahul H 4Rahul H 4 

query inactive user record

I want to query in Salesforce database for an inactive user to check if he is owning any records or not?
I tried to query in Salesforce data loader but it only queries on one entity at a time. Also, the same behavior is shown for Reports wherein one entity gets queried at a time. 

Please advise further. Thanks
SHAHNA MULLASHAHNA MULLA

Hi Rahul,

Try this........,

1.
Create a formula field of type Checkbox on the object and formula will be 'Owner.IsActive'. It returns true if Owner is Active otherwise false.
Then create a report on the object with this checkbox = false as filter.
This report will give you the number of records which are owned by inactive users.

2.
Run a query in developer console which will give you the count of records which are owned by inactive users.
For Ex:
Select count() FROM Contact WHERE Owner.isActive = false

Also check this link : https://help.salesforce.com/articleView?id=000004964&type=1

Can you please Let me know if it helps or not!!!
Thanks......
Ajinkya WankhedeAjinkya Wankhede
try below query it works
Select ID ,Name FROM User WHERE isActive = false
Ram RajatRam Rajat
try Select ID ,Name FROM User WHERE isActive = false  satta king (https://deshawaroffice.com)