Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Is there any way to query for Google Doc Attachments? For instance, the following SOQL queries return all Notes and Attachments whose parent is a Salesforce.com record, but I can't find any equivalent for retrieving Google Doc Attachments:

[SELECT Id, Name FROM Attachment WHERE ParentId=:opportunity.Id]
[SELECT Id, Title FROM Note WHERE ParentId=:opportunity.Id]

Here is a dev boards forum post from 2008 that is still unanswered: Apex Google Doc attachment

Google Doc Attachments appear to be one of those "phantom" objects which support some of the Salesforce.com API features, but are not fully exposed. For instance, from what I can tell, this object has the following standard API features:

  1. It has a Key Prefix (098 in one of my orgs, might be the same everywhere)
  2. Each record has a detail/edit/delete page

But it does NOT support the following:

  1. Doesn't show up as a Schema object (e.g. through getGlobalDescribe())
  2. Doesn't support SOQL

Does anyone have a solution for programmatically (but WITHOUT screen-scraping) retrieving Google Docs attached to a record?

EDIT 1/2/2013

A 'GoogleDoc' object is exposed via Web Services API, supposedly with full CRUD and query permissions! But it is not showing up in SOQLExplorer or AJAX Toolkit. Any gotchas/prerequisites I'm missing?

Also, I can get at the SObjectType token by taking a GoogleDoc's Id and then calling docId.getSObjectType(). But doing a getDescribe() on that token throws an Internal Salesforce System Error: 129447016-92475 (-1350247506).

From AJAX Toolkit, I called sforce.connection.describeSObject('GoogleDoc'), and retrieved the following:

INVALID_TYPE: sObject type 'GoogleDoc' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Finally figured this out: you must contact Salesforce.com Support to have API Access to the GoogleDoc object enabled for a given org. Once this was done, everything worked as expected.

share|improve this answer

With api v29 you can now use the CombinedAttachment object to retrieve Gdocs along with Notes & Attachments. Still need to call support to enable API access for Google Docs though.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_combinedattachment.htm

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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