0

I need to search for Partner Accounts that don't have a Partner Agreement attached in the Files section. To find that, I believe the best way is to get a list of all Files attached to the Accounts that match the criteria. I managed to get a list of Files ID, but that is a bit useless for my purpose, what I really need is to include the Title in the results. Is this possible?

Here is my query so far, but I get an error saying

INVALID_FIELD: SELECT ContentDocumentID, ContentDocumentLinks.Title FROM ^ ERROR at Row:1:Column:27 Didn't understand relationship 'ContentDocumentLinks' in field path.

SELECT ContentDocumentID, ContentDocumentLinks.Title 
FROM   ContentDocumentLink 
WHERE  LinkedEntityId IN
  (SELECT ID FROM Account 
  WHERE   Type = 'Active Partner (signed contract)' 
  OR      Type = '2-Tier Partner')

Any help would be much appreciated.

  • Do you want to fetch document's Title? Did you try using this name 'ContentDocument.Title' instead of ContentDocumentLinks.Title – Hemant Jain Nov 9 '17 at 11:51
0

There is not Title on ContentDocumentLink, availible fields are documented here

You could instead query the LinkedEntity.Name or the ContentDocument.Title if that hepls:

SELECT ContentDocumentID, LinkedEntity.Name, ContentDocument.Title
FROM   ContentDocumentLink 
WHERE  LinkedEntityId IN
  (SELECT ID FROM Account 
  WHERE   Type = 'Active Partner (signed contract)' 
  OR      Type = '2-Tier Partner')

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.