Mobile Locker JavaScript SDK
    Preparing search index...

    Variable crmConst

    crm: {
        getAccounts(): Promise<unknown>;
        getAccount(accountID: string): Promise<unknown>;
        getAddresses(): Promise<unknown>;
        getAddress(addressID: string): Promise<unknown>;
        getContacts(): Promise<unknown>;
        getContact(contactID: string): Promise<unknown>;
        getLeads(): Promise<unknown>;
        getLead(leadID: string): Promise<unknown>;
        getUsers(): Promise<unknown>;
        getUser(userID: string): Promise<unknown>;
        openCustomerPicker(): Promise<PickerResult>;
        getCurrentCustomers(): Promise<Customer[]>;
        getRecentCustomers(): Promise<Customer[]>;
        isCurrentCustomer(objectID: string): Promise<boolean>;
        setCurrentCustomers(customerIDs: string[]): Promise<void>;
        addCurrentCustomer(customerID: string): Promise<void>;
        removeCurrentCustomer(customerID: string): Promise<void>;
        clearCurrentCustomers(): Promise<void>;
        refresh(options?: { mode?: CRMRefreshMode }): Promise<CRMRefreshResult>;
        query(
            soql: string,
            parameters?: Record<string, unknown>,
        ): Promise<CRMQueryResult>;
    } = ...

    Type Declaration

    • getAccounts: function
      • Get all CRM accounts synced for the current user.

        Returns Promise<unknown>

        Raw account records from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getAccount: function
      • Get a specific CRM account by ID.

        Parameters

        • accountID: string

          The CRM account ID to fetch.

        Returns Promise<unknown>

        Raw account record from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getAddresses: function
      • Get all CRM addresses synced for the current user.

        Returns Promise<unknown>

        Raw address records from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getAddress: function
      • Get a specific CRM address by ID.

        Parameters

        • addressID: string

          The CRM address ID to fetch.

        Returns Promise<unknown>

        Raw address record from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getContacts: function
      • Get all CRM contacts synced for the current user.

        Returns Promise<unknown>

        Raw contact records from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getContact: function
      • Get a specific CRM contact by ID.

        Parameters

        • contactID: string

          The CRM contact ID to fetch.

        Returns Promise<unknown>

        Raw contact record from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getLeads: function
      • Get all CRM leads synced for the current user.

        Returns Promise<unknown>

        Raw lead records from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getLead: function
      • Get a specific CRM lead by ID.

        Parameters

        • leadID: string

          The CRM lead ID to fetch.

        Returns Promise<unknown>

        Raw lead record from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getUsers: function
      • Get all CRM users synced for the current team.

        Returns Promise<unknown>

        Raw user records from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • getUser: function
      • Get a specific CRM user by ID.

        Parameters

        • userID: string

          The CRM user ID to fetch.

        Returns Promise<unknown>

        Raw user record from the connected CRM.

        MobileLockerCRMError on network failure, auth expiry, or server error.

    • openCustomerPicker: function
      • Open the native customer picker UI and let the user select one or more customers.

        Returns Promise<PickerResult>

        An object with status ('selected' or 'cancelled') and an optional customers array.

        iOS app only. Throws in all other environments.

        MobileLockerError if called outside the iOS app.

        MobileLockerCRMError on network failure or server error.

        const { status, customers } = await mobilelocker.crm.openCustomerPicker()
        if (status === 'selected') console.log(customers)
    • getCurrentCustomers: function
    • getRecentCustomers: function
    • isCurrentCustomer: function
      • Check whether a CRM object is currently associated with the active session.

        Parameters

        • objectID: string

          The CRM object ID to check (e.g. a Salesforce Account ID).

        Returns Promise<boolean>

        true if the customer is current, false otherwise.

        MobileLockerCRMError on network failure or server error.

    • setCurrentCustomers: function
      • Replace the current customers for the active session.

        Parameters

        • customerIDs: string[]

          Array of CRM object IDs to set as current.

        Returns Promise<void>

        MobileLockerCRMError on network failure or server error.

    • addCurrentCustomer: function
      • Add a single customer to the current session without replacing existing ones.

        Parameters

        • customerID: string

          The CRM object ID of the customer to add.

        Returns Promise<void>

        MobileLockerCRMError on network failure or server error.

    • removeCurrentCustomer: function
      • Remove a single customer from the current session.

        Parameters

        • customerID: string

          The CRM object ID of the customer to remove.

        Returns Promise<void>

        MobileLockerCRMError on network failure or server error.

    • clearCurrentCustomers: function
    • refresh: function
      • Trigger a CRM data refresh for the current user.

        Parameters

        • Optionaloptions: { mode?: CRMRefreshMode }
          • Optionalmode?: CRMRefreshMode

            'incremental' (default) syncs only new/changed records; 'full' re-syncs everything.

        Returns Promise<CRMRefreshResult>

        An object with status: 'started' if the refresh was queued, 'not_connected' if the CRM is unreachable.

        MobileLockerCRMError on auth expiry or server error.

        const { status } = await mobilelocker.crm.refresh({ mode: 'full' })
        
    • query: function
      • Execute a SOQL query against the connected CRM.

        Parameters

        • soql: string

          A valid SOQL SELECT statement.

        • Optionalparameters: Record<string, unknown>

          Optional named bind parameters referenced in the SOQL string.

        Returns Promise<CRMQueryResult>

        A CRMQueryResult containing rows, totalSize, and done.

        MobileLockerCRMError with code SOQLInvalid on a syntax error, or on network/auth failure.

        const result = await mobilelocker.crm.query('SELECT Id, Name FROM Account WHERE Name = :name', { name: 'Acme' })