Skip to content

The SOSL Lib provides functional constructs for SOSL queries in Apex.

License

Notifications You must be signed in to change notification settings

beyond-the-cloud-dev/sosl-lib

Repository files navigation

SOSL Lib

Deploy to Scratch Org and run tests codecov

The SOSL Lib provides functional constructs for SOSL queries in Apex.

For more details, please refer to the documentation.

Examples

// FIND 'Company' RETURNING Account
List<List<SObject>> searchResults = SOSL.find('Company')
    .returning(SOSL.Returning(Account.SObject))
    .toSearchList();
// FIND 'Company' RETURNING Account(Id, Name ORDER BY Name)
List<List<SObject>> searchResults = SOSL.find('Company')
    .returning(
        SOSL.Returning(Account.SObject)
            .with(Account.Id, Account.Name)
            .orderBy(Account.Name)
    )
    .toSearchList();

Deploy to Salesforce

Deploy to Salesforce

Documentation

SOSL Lib documentation

Features

Read about the features in the documentation.

  1. Dynamic SOSL
  2. Control FLS
  • 2.1 User Mode
  • 2.2 System Mode
  • 2.3 stripInaccessible
  1. Control Sharings Mode
  • 3.1 with sharing
  • 3.2 without sharing
  • 3.3 inherited sharing
  1. Mocking
  • 4.1 Mock list of records
  1. Dynamic conditions

License notes

  • For proper license management each repository should contain LICENSE file similar to this one.
  • Each original class should contain copyright mark: Copyright (c) 2023 BeyondTheCloud.Dev

About

The SOSL Lib provides functional constructs for SOSL queries in Apex.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published