1

I have built up a dynamic search query using sosl

The query string given below

 FIND {a016g00000D57xKAAR} IN ALL FIELDS RETURNING Attachment(ParentId), ContentVersion(FirstPublishLocationId), ContentDocumentLink(ContentDistribution(RelatedRecordId), AttachedContentDocument(LinkedEntityId), CombinedAttachment(ParentId), Note(ParentId), NoteAndAttachment(ParentId), ProcessInstance(TargetObjectId), TaskChangeEvent(WhatId), EventChangeEvent(WhatId), EventRelationChangeEvent(RelationId), LookedUpFromActivity(WhatId), TopicAssignment(EntityId), DuplicateRecordItem(RecordId), RecordAction(RecordId), FlowRecordRelation(RelatedRecordId), ActivityRecurrence2(WhatId), ActivityRecurrence2Exception(WhatId), ContactRequest(WhatId), AssessmentTaskContentDocument(ContentContextId), Author__c(Author__c,Author12__c), Author__ChangeEvent(Author__c,Author12__c), Book__c(Author__c,Master_Author__c), Book__ChangeEvent(Author__c,Master_Author__c)

But when I run the query, both in the apex class as well as the query editor, it gives me the following error

 AssessmentTaskContentDocument(ContentContextId), 
 Author__c(Author__c,Author12__c), Author__ChangeEvent(Author__c
                    ^
 ERROR at Row:1:Column:716 Malformed search token: ','

1 Answer 1

1

entity type ContentDocumentLink does not support search also the query syntax is wrong correct the syntax to below and you'll get the correct error .

                            FIND {a016g00000D57xKAAR} IN ALL FIELDS RETURNING Attachment(ParentId), ContentVersion(FirstPublishLocationId), 

                            ContentDocumentLink(
                            ContentDistribution(RelatedRecordId), 
                            AttachedContentDocument(LinkedEntityId), 
                            CombinedAttachment(ParentId), 
                            Note(ParentId),
                            NoteAndAttachment(ParentId), 
                            ProcessInstance(TargetObjectId), 
                            TaskChangeEvent(WhatId), 
                            EventChangeEvent(WhatId), 
                            EventRelationChangeEvent(RelationId), 
                            LookedUpFromActivity(WhatId), 
                            TopicAssignment(EntityId), 
                            DuplicateRecordItem(RecordId), 
                            RecordAction(RecordId), 
                            FlowRecordRelation(RelatedRecordId), 
                            ActivityRecurrence2(WhatId), 
                            ActivityRecurrence2Exception(WhatId), 
                            ContactRequest(WhatId),
                            AssessmentTaskContentDocument(ContentContextId),
                            Author__c(Author__c),
                            Author__ChangeEvent(Author__c), 
                            Book__c(Author__c), 
                            Book__ChangeEvent(Author__c),

                            )

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .