Регистрация  |  Вход

Запрос возвращает пустыми поля ContentDocument записей

собственно проблема не является специфичной для лайтнинг, но ситуация где пришлось связываться с ContentDocumentLink и ContentDocument вызвана использованием <lightning:fileUpload />

я не нашел другого способа загружать файлы в Аура компоненте

причем <lightning:fileUpload /> загружает файлы не как старые-добрые аттачменты, а как ContentDocumentLink и ContentDocument. И я бы не стал жаловаться на них, но если попробовать кверить ContentDocumentLink или ContentDocument, например вот так:

[SELECT id, contentDocument.Title, ContentDocument.FileExtension, ContentDocument.CreatedDate FROM ContentDocumentLink]

или напрямую кверить ContentDocument, результат один: записи приходят, но приходят пустыми, даже для СисАдмина

собственно проблема не является специфичной для лайтнинг, но ситуация где пришлось связываться с ContentDocumentLink и ContentDocument вызвана использованием <lightning:fileUpload />

я не нашел другого способа загружать файлы в Аура компоненте

причем <lightning:fileUpload /> загружает файлы не как старые-добрые аттачменты, а как ContentDocumentLink и ContentDocument. И я бы не стал жаловаться на них, но если попробовать кверить ContentDocumentLink или ContentDocument, например вот так:

[code][SELECT id, contentDocument.Title, ContentDocument.FileExtension, ContentDocument.CreatedDate FROM ContentDocumentLink][/code] 

или напрямую кверить ContentDocument, результат один: записи приходят, но приходят пустыми, даже для СисАдмина

там спец правила для квери, нельзя кверить без указания парента


You can't run a query without filters against ContentDocumentLink.
You can't filter on ContentDocument fields if you're filtering by ContentDocumentId. You can only filter on ContentDocument fields if you're filtering by LinkedEntityId.
You can't filter on the related object fields. For example, you can't filter on the properties of the account to which a file is linked. You can filter on the properties of the file, such as the title field.

там спец правила для квери, нельзя кверить без указания парента


You can't run a query without filters against ContentDocumentLink.
You can't filter on ContentDocument fields if you're filtering by ContentDocumentId. You can only filter on ContentDocument fields if you're filtering by LinkedEntityId.
You can't filter on the related object fields. For example, you can't filter on the properties of the account to which a file is linked. You can filter on the properties of the file, such as the title field.

A SOQL query must filter on one of Id, ContentDocumentId, or LinkedEntityId.

A SOQL query must filter on one of Id, ContentDocumentId, or LinkedEntityId.