Salesforce Hub

Salesforce Hub is affected by the iframe authentication limitation.
Your SmartHub site must be opened in a new browser tab for the authentication to work properly.

About Salesforce Hub

To integrate SmartHub with Salesforce, install the BA Insight SmartHub package (application) into your Salesforce system.

The SmartHub package for Salesforce offers multiple integration types:

  • Full Search
    • SmartHub Search Center is displayed as a full page.
    • Accessible from:
      • BA Insight SmartHub Enterprise Search page
      • A Salesforce App (for quick access)
  • Local Search
    • SmartHub Search Center is displayed as part of a section on the page (with the ability to interact between SmartHub and Salesforce).
    • Accessible from the pages where the SmartHub Local Search component is added.
    • Can be added to the Salesforce Utility bar (at the bottom of the page).
    • Enables the Local Search to be quickly accessible.
  • Search box with Type-Ahead
    • Only available in Salesforce Community Sites:
      • The SmartHub Search box allows a multitude of suggestion providers.

Prerequisites

  • SmartHub must be installed and accessible via the HTTPS protocol.
    • This requires a trusted, valid certificate to be configured in the IIS bindings

How to Install the SmartHub Salesforce Package

  1. To install the Salesforce package navigate to the SmartHub installation directory under the /integrations/sf/ directory.
  2. Open the file Install.txt.
  3. Copy the Salesforce package installation URL.
  4. When navigating to the URL you are prompted by Salesforce to install the package.

Full Search Integration

  • The Full Search component is a Salesforce page which displays a SmartHub Results page.

  • It can be configured to display any page that exists in your SmartHub instance.

How to Access the Full Search Page

  1. Navigate to your Salesforce instance and use the App launcher to open the BA Insight SmartHub Enterprise search page.
  2. Create an App which allows quick access to "Full Search".
    1. Log in to Salesforce instance and go to "Setup" .
    2. In the "Quick find" search for "App Manager".
    3. Click "New Lightning App" and go through the app creation wizard.
      1. In the "Navigation Items" step, select "BA Insight SmartHub Enterprise search".
  3. The app now appears in App launcher.

Configure the Full Search Integration

  1. Navigate to your Salesforce instance and use the App launcher to open the BA Insight SmartHub Configuration page.
  2. On the Configuration page enter the settings that match your SmartHub installation.

Options to Configure

Property Name

Usage

Sample values

Address to your full page search
  • The SmartHub HTTPS address of the page to be opened by the Full Search page.
  • Must be accessible from the machine accessing Salesforce
  • If this page is hosted internally on your intranet:
    • Users must be connected to your intranet to access the page.
https://smarthub.contoso.com/

Add the Local Search Part

Add the Local Search part to your Salesforce page for full search integration.

Configure the Local Search part:

  1. Navigate to any page where you added the "Local Search" component.

  2. Enter edit mode by clicking in the "Edit page" button.

  3. Locate the "Local Search" component and click on it.
  4. Configure the component using the options in the table Local Search Options to Configure.

Local Search Integration

The Local Search component displays a SmartHub page in Salesforce within an iframe.

You can choose:

  • Size of iframe
  • The context property to be used as the search query text

Add Local Search to Your Pages

Note: The developer service must be published and have a custom domain to set the Local Search component.

  • The Local Search component can be added to any Salesforce page where it is required.

  • Use the following steps to add the component to pages:

  1. Navigate to the page (for example Accounts).
  2. Enter edit mode by using the gear button at the top. Edit Page mode begins.


  3. Next, insert the SmartHub Local Search component in any section you desire.
    This component reads the width and height from the configuration options of the SmartHub package.

     
  4. Click Save at the top left to save any changes made to the page.

Note: If you use the Local Search component in a Community site then you are asked to add the SmartHub address to the Salesforce CSP Trusted Sites:

  1. Click "New trusted site."
  2. Provide the SmartHub URL and a name.
  3. From "Context" select "Experience Builder Sites."
  4. Select all directives.
  5. Save.

Configure the Local Search Integration

  1. Navigate to any page where you added the "Local Search" component.
  2. Add the Local Search component:
    1. Enter edit mode by clicking in the "Edit page" button.
    2. Locate the "Local Search" component and click on it.
    3. Configure the component using the options in the "Local Search Options to Configure" in the table below.
  3. Save your changes.

Local Search Options to Configure

Property Name

Usage

Sample Values

SmartHub Page URL

This is the SmartHub HTTPS address of the page that should be opened by the Local Search component.

  • This address must be accessible from the machine that accesses Salesforce.

  • If this page is hosted internally in your intranet the users must be connected to your intranet before they can access the page. 

  • The address URL must have: #pn=salesforce

https://smarthub.contoso.com/index.html#pn=salesforce&ribbon=false

Container Height This is the CSS height of the Local Search component iframe. 800px
Container Width This is the CSS width of the Local Search component iframe. 100% or 800px
Frame Id This is the ID of the Local Search component iframe. If you use multiple components on the same page then you must provide different IDs for each component. smartHubFrame
Query Field
  • SmartHub Local Search automatically runs a search with the value of the configured properly for the page you are viewing. 

  • For example if you are on the Account page, and you configured this property to be Account.name then the Local search passes the current account name to be searched when the page is loaded.

  • You can configure as many properties as you want in the format object1.field1,object2.field2.

  • You cannot configure multiple fields form the same object (object1.field1,object1.field2).

To find the required object and field use these steps:

  1. Go to Object manager.
  2. Select the required object.
  3. Click the required object.
  4. Under Fields & Relationships, select the required field.
Important! If you add the Local Search in a Community Site which uses the SmartHub Search Box component then set this to {searchboxquery}. This ensures the current page query text is used.
Account.name

Search Box with Type-Ahead Integration

  • This component is a Salesforce "Search Interface" which can be used in Salesforce Community sites.

  • This component replaces the default "Global Search Box".

How to Add Search Box to Your Salesforce Community Site

Add the Search Box component to your site following the next steps:

  1. Go to your Community site.
  2. Enter edit mode by going to Experience Builder (click on your User Name to expand the account menu)
  3. Click "Settings" in the controls group (left side - cog icon).
    1.  Go to "Security & Privacy"
      1. Content Security Policy
        1. Switch to "Relaxed CSP: Permit Access to Inline Scripts and Allowed Hosts"
      2. Lightning Locker
        1. Turn off
      3. Trusted sites for scripts
        1. Add your SmartHub URL here
  4. Go to SmartHub install location and locate the file web.config.
    1. Open the file for editing.
    2. Uncomment the section related to cross domain requests.
    3. Specify the Salesforce site address in the parameter Access-Control-Allow-Origin
  5. If your SmartHub instance is secured then you must create a custom Login page:
    1. From the "Pages" menu click "+ New Page"
    2. Select Standard Page, Flexible Layout
    3. Name the page "shlogin" or choose a custom name 
    4. Click Create
    5. Go to "Page Properties" (gear-icon near the page name) and select "Override the default theme layout for this page" and select "Login"
    6. From the "Components" section add the "BAInsight_SmartHub_Login" component
      1. Sample value: https://smarthub.contoso.com
    7. Specify the SmartHub address (No trailing '/') in the "BAInsight_SmartHub_Login" component options.
    8. Publish the newly created page.

      Note: If SmartHub is secured with Azure AD authentication then you must add the log-in page URL to the "allowed Redirect URIs" for the SmartHub App Registration

  6. Navigate back to your Community Site and open Experience Builder.
  7. Click "Theme" in the controls group (left side - brush icon).
    1. Go to "Theme Settings".
  8. Under "Search Component" select "BAInsight SmartHub Search Box".
  9. Configure the "BAInsight SmartHub Search Box" component according to the settings table below.

Add the Local Search Component

Add the Local Search component to your Salesforce page for Type-Ahead integration:

  1. Navigate to the page where the search bar redirects the user to.

  2. Add the "Local Search" component:

    1. Enter edit mode by clicking in the "Edit page" button.
    2. Locate the "Local Search" component and click on it. Refer to Add Local Search to Your Pages.
    3. Configure the component using the options in the table below.
  3. Save your changes.

Options to Configure

Property Name

Usage

Sample values

Search Page
  • This is the Community Site page where searches are redirected.

  • This path must end in '/'

/global-search/

SmartHub Address
  • Your SmartHub instance address.

  • No trailing '/' characters in the address.

https://smarthub.contoso.com
Search Box Settings File

This is the address of the file which contains your custom settings for the SearchBox TypeAhead.

  • This file has to be a copy of the default "SearchBoxCustomSettings.js" file found at <SHInstallLocation>/integrations/sf/TypeAheadForSF/
  • Do not modify the file SearchBoxCustomSettings.js directly (<SHInstallLocation>/integrations/sf/TypeAheadForSF/SearchBoxCustomSettings.js).
    • Make a copy of it and put it under a customizations folder (ex: <SHInstallLocation>/customer/SalesforceIntegration).
  • Provide the file copy address in the "Search Box Settings File" setting.
https://smarthub.contoso.com/customer/SalesforceIntegration/SearchBoxCustomSettings.js
SmartHub Login Page
  • The relative URL of the custom login page that you created in step 5. above. (shlogin custom page).

Important! If your SmartHub instance is secured then the login page must be created prior to adding the search box component on the page.
  • The Sample value needs to be changed. The new value will be of the format: /NameOfTheComunitySite/s/NameOfTheLoginPage

  • The address must be relative to the site root (start with '/'). Do not include a trailing '/'.

/mysite/s/shlogin

Note: If your SmartHub address is secured then you must add "https://login.microsoftonline.com" to the list of CSP Trusted Sites in Salesforce.

Note: If the Search Box uses the People provider then you must include the address from where the pictures are loaded

  • Example: https://contoso-my.sharepoint.com) to the list of CSP Trusted Sites in Salesforce.

How to Upgrade the Salesforce Plug-in

From within Salesforce, perform the following steps to upgrade the Salesforce plug-in.

First, you uninstall the individual package components from within Salesforce, and then you install the new Salesforce application.

  1. From the Setup menu, enter the Installed Packages in the "Quick Find" box, and then select "Installed Packages." See the graphic below.
  2. Click the Uninstall button next to the package that you want to remove. See the graphic below.


  3. Scroll down and select the check-box “Yes, I want to uninstall this package and permanently delete all associated components”. See the graphic above.
  4. As you remove the components from each page you receive the following errors.


  5. Click one of the links on the page, the Account_Record_Page.


  6. Click Edit.


  7. Select the section.
  8. Click Delete, Save, and Activation in the top right corner of the page. 


  9. A pop-up appears to confirm that you have successfully deleted the component.


  10. Close the pop-up and continue to remove components from the rest of your pages.


  11. Now follow the installation process for the new version of the Salesforce plug-in.

How to Update the Salesforce Plug-In

  1. To update the plug-in, first uninstall the plug-in completely.
  2. Perform a new installation of the plug-in.  

How to Uninstall the Salesforce Plug-in

Local Search Component

To uninstall the SmartHub local search component plug-in, use these steps:

  1. First, go through each page where a SmartHub local search component is set up as described above in the topic "How to Upgrade the Salesforce Plug-in."
  2. Remove the search component.

Login/Search bar Component

If you have set up the integration on a community site you must uninstall the SmartHub login component/search bar, use these steps:

  1. The SmartHub login component/search bar are removed the same way you remove any Salesforce components.

    • See Salesforce documentation about how to remove Salesforce components.

Results Page

Uninstall the SmartHub Results page, use these steps:

  1. The SmartHub Results page is removed the same way you remove any Salesforce component.

    • See Salesforce documentation about how to remove Salesforce components.

Community Site

If you have integrated SmartHub with a community site, uninstall the Community site plug-in with the following steps:

  1. Uninstall Community site plug-in.
  2. Remove the search component.