3

I have a query as below:

 SELECT  CaseId,CreatedById,CreatedDate,Field,Id,IsDeleted,NewValue,OldValue FROM CaseHistory

In my query NewValue,OldValue not getting in workbench.But same query working in developer console.May I know the reason why not getting in workbench.

5
  • Can you post a snapshot of what it is returning ? Mar 8, 2016 at 6:50
  • @ karthikselva thanks for your response.I am not able to add screenshot here.
    – Jansi
    Mar 8, 2016 at 7:12
  • I know that oldvalue and newvalue are special. For example, in reports you can query these fields, but you can't filter on them. Maybe your issue is related. Mar 8, 2016 at 7:39
  • What is the type of the field for which you want to see the changes? Mar 8, 2016 at 8:02
  • Can you confirm that you are using the same login in both cases?
    – Keith C
    Mar 8, 2016 at 8:37

1 Answer 1

7

I tried your query in workbench and I was surprised not to see any result for Newvalue and Oldvalue.

Then i shuffled the positions of NewValue and OldValue in the query and saw that it works.

Query: SELECT NewValue,OldValue, CaseId,CreatedById,CreatedDate,Field,Id,IsDeleted FROM CaseHistory

Result:

enter image description here

I believe it might be a bug.

4
  • That is an interesting find, I like these kinds of errors. Mar 8, 2016 at 13:04
  • When I try SELECT OldValue,NewValue,Id,Field FROM CaseHistory WHERE Field = 'Status' ORDER BY CreatedDate ASC NULLS FIRST, I get as columns: Id Unknown_Field__1 Unknown_Field__2 Field, and I still don't know which is the oldvalue and which the newvalue. And column aliasing is not allowed for simple columns, Mar 9, 2016 at 8:40
  • Also, the number of returned columns depends on whether I use a WHERE clause or not, in my case at least. Mar 9, 2016 at 8:42
  • @Sander de Jong.. I think there is some bug in Workbench. i am getting proper results in Developer Console for your Query.
    – Jansi
    Mar 9, 2016 at 9:03

You must log in to answer this question.

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