0

I was trying all listviews for Event sobject but nothing's working for me?

/services/data/v42.0/sobjects/Event/listviews/{id}/results

INVALID_FIELD message: What.Name, ActivityDate, toLabel(Status), toLabel(Priority), Owner.Alias ^ ERROR at Row:1:Column:60 No such column 'Status' on entity 'Event'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. errorCode: INVALID_FIELD

Is it possible grab OpenActivies which represent both Task and Event to particular user?

1

Event and Task are two different objects that are coalesced under the activities related list. Since the user is referenced on the objects by making them the owner of the object, there is no direct lookup relationship you can query using a sub-query (verified in WSDL)

So the short answer is, no, there's no way to get them in a single query.

If you're using Rest, use this documentation for help on querying records.

Then you simply run two seperate queries, one for event and one for task.

SELECT Id, Status FROM Task WHERE OwnerId = <user's Id Here>
SELECT Id, Field__c FROM Event WHERE OwnerId = <user's Id Here>

Alternatively, if you're using related lists as your question suggests, use a related list from both objects:

/services/data/v42.0/sobjects/Event/listviews/{id}/results
/services/data/v42.0/sobjects/Task/listviews/{id}/results

The error you posted is specifically because you're looking for "Status" on the event object which; does not have a status field. Status is a task field. The question you posted doesn't contain enough information to properly troubleshoot that issue so if you want some help with that error you should remove the error form this question and paste that error into a new question with some code as a sample.

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.