• shashvat
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi

 

I m trying to execute the query below to extract values of fields - ActivityDate and Subject into a visualforce table :

 

SELECT(SELECT ActivityDate, Subject FROM ActivityHistories ORDER BY ActivityDate DESC LIMIT 1) FROM Case where Case.CaseNumber='00017011'

 

How to get the values of fields of inner queries to be displayed?

 

Is there any other work around as ActivityHistory is not query-able directly ?

 

My issues is that I have to construct a table that has some column values from SOQL queries Activity History, some values from Case object and values coming from an APi call to an external server. I m able to do the rest of the part but I m not still able to extract field values for ActivityHistory.

 

Please guide me with the same.

hi, bit of a problem with ActivityHistory

Documentation on ActivityHistory states:

Issue a SOQL relationship query with a main clause that references the object, and an inner clause that references the activity history, for example:
SELECT (SELECT ActivityDate, Description from ActivityHistory) FROM Account WHERE Id = '" + accId + "'"

When I issue this call from within my app:
SELECT (SELECT ActivityDate, Description from ActivityHistory) FROM Account WHERE Id = '00120000002dYd4'

the API returns me this error:
INVALID_TYPE: Didn't understand relationship 'ActivityHistory' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

So either the documentation or the API is wrong? Anyone know the correct way to get a list of activity history entries as part of an SOQL relationship query?

Cheers,
Moray