Skip to content

Support toLabel in SOSL queries #51

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

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

adangel
Copy link
Contributor

@adangel adangel commented Aug 30, 2024

Current toLabel causes a parser error:

public with sharing class ParseErrorTest {
    public Object doSoslSearch() {

        List<List<SObject>> searchResults = [
                FIND :searchTerm
                IN ALL FIELDS
                RETURNING
                        Account(Id, toLabel(Name))
                LIMIT 10
        ];
        
        return null;        
    }
}

Error:

Syntax error at 9:43: mismatched input '(' expecting {'using', 'where', 'order', 'limit', 'offset', ')'}
Syntax error at 9:49: mismatched input ')' expecting {'instanceof', ')', '[', '.', '=', '>', '<', '?.', '?', '==', '===', '!=', '<>', '!==', '&&', '||', '??', '++', '--', '+', '-', '*', '/', '&', '|', '^', '+=', '-=', '*=', '/=', '&=', '|=', '^=', '<<=', '>>=', '>>>='}
Syntax error at 11:8: extraneous input ']' expecting ';'

sf doc: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_tolabel.htm

Original reported at: pmd/pmd#5163

@pwrightcertinia pwrightcertinia merged commit aeb4b19 into apex-dev-tools:main Sep 2, 2024
1 check passed
@adangel adangel deleted the sosl-tolabel branch September 26, 2024 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants