function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DEV_CGDEV_CG 

Invalid field case.status for CaseHistory

Hi everyone, 
could you please help me in this

When I queried using Query editor, am able to fetch the records from case history. but
when I write in apex class as dynamic query using case history, am getting below error
12:43:35:070 USER_DEBUG [64]|DEBUG|The following exception has occurred: Invalid field case.status for CaseHistory
Nandigam RajeshNandigam Rajesh
Hi Begineer,
Make sure that all words are spelled correctly.
Try different keywords.


Regards
Rajesh
Raj VakatiRaj Vakati
Try this


Make sure you have field history on status  field
SELECT CaseId,CreatedById,CreatedDate,Field,Id,NewValue,OldValue FROM CaseHistory


OR

 
SELECT Case.status ,CreatedById,CreatedDate,Field,Id,NewValue,OldValue FROM CaseHistory

 
DEV_CGDEV_CG
Raj/Rajesh
I am able to fetch the deatils from QueryEditoe by using below query.
select caseid,case.status,case.createdDate,id from CaseHistory
but when I send this query to start method, I am not able fetch these details only id from CaseHistory is got fetched.
i checked the logs, i see error as case.status filed invalid value, if i remove it i see case.createdDate is invalid filed..
suggest me how to do this