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.

  • Can you post a snapshot of what it is returning ? – karthikselva Mar 8 '16 at 6:50
  • @ karthikselva thanks for your response.I am not able to add screenshot here. – Jansi Mar 8 '16 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. – Sander de Jong Mar 8 '16 at 7:39
  • What is the type of the field for which you want to see the changes? – rael_kid Mar 8 '16 at 8:02
  • Can you confirm that you are using the same login in both cases? – Keith C Mar 8 '16 at 8:37
6

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.

  • That is an interesting find, I like these kinds of errors. – rael_kid Mar 8 '16 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, – Sander de Jong Mar 9 '16 at 8:40
  • Also, the number of returned columns depends on whether I use a WHERE clause or not, in my case at least. – Sander de Jong Mar 9 '16 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 '16 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.