-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance SOSL to support AnyPublisher<QueryResult<T> #123
Comments
@perbrondum the Salesforce REST API What is your requirement? What are you trying to achieve? |
Finding an efficient fast way to find all object records (or nil) belonging
to a company.
FIND {tap2sales} In name FIELDS RETURNING Account(id, name),
opportunity(id, name), contact(id, name, accountId)
Basically if I could get the above (simplified) query to work, and separate
the records by type, I'd be happy. How would you refer to the "contact ID"
in the above sosl?. Using id.prefix(4) == 0061 to identify an Opportunity
post query does not seem ideal but it may be the only way.
I have it working in SOQL (multiple queries) but the power of SOSL when
looking for a name across types is simpler and I'd like to use it.
Per
…On Mon, Sep 14, 2020 at 6:42 PM Michael Epstein ***@***.***> wrote:
@perbrondum <https://github.com/perbrondum> the Salesforce REST API search
resource returns an array of records, and those records could be of
different types depending on the domain of the SOSL search. In contrast,
QueryResult for a SOQL search includes records of only 1 type, and
includes metadata about the search results.
What is your requirement? What are you trying to achieve?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#123 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALCYWDAHZTD2NCVVF3AWNFTSFZBY3ANCNFSM4RIN3XWA>
.
|
@perbrondum do all the objects you're looking for have a lookup relationship to Account (e.g. Opportunity and Contact)? If so, you could use a parent-to-child SOQL query. I don't understand your second paragraph about ID prefixes and referring to Contact ID - would you clarify? (Also: only the first 3 characters of the record ID could be used to discern the object type -- see this help article.) |
Using parent-child gets complicated with outer joins especially as we want to expose null records. Below's an example of what I meant with contact Id. |
Hi @perbrondum the results will be returned in an array of Records. The |
Beautiful. This is just awesome. Thanks. let sosl = "FIND {%(textField.text!)%} IN Name FIELDS RETURNING Account(id, Name, BillingStreet, BillingCity, BillingPostalCode, BillingState, BillingCountry, lastActivityDate), Contact(id, name, MailingStreet, MailingCity, MailingPostalCode, MailingState, MailingCountry), Opportunity(id, name, expectedRevenue)"
|
Is there any reason SOSL can not support AnyPublisher<QueryResult?
The text was updated successfully, but these errors were encountered: