0

I am trying to pull the user (person who made the change) via SOQL query on cases. This is not a "standard" field in the API Developers guide for CaseHistory but it is available for standard history reports. Here is my current query to pull all available fields. Any suggestions on how to add the user that made the changes?

SELECT CaseId, DataType, Field, NewValue, OldValue, ID FROM CaseHistory

2 Answers 2

1

For any field history record, the user who made the edit to the parent record, is the user who created the field history record. So you can use CreatedById to get the user id, use relationships to get more information about the user (ie CreatedBy.Name).

0

You can use SOQL like below to fetch the Last Modified User name:

SELECT ID, Subject, Type,LastModifiedDate, LastModifiedBy.Name, CreatedDate, CreatedBy.Name, (SELECT Field, OldValue, NewValue FROM Histories) FROM Case

The child history relationship name is called "Histories".

Learn More Here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .