Knowledge Base/Solutions for Soapbox 2/Salesforce Search

Filter results by logged in user's Contact record or Account record

Tim Forbes
posted this on October 25, 2011 05:46 pm

If your site has a password-protected area and user accounts are connected to a Contact record in your Salesforce instance, you have the ability to filter results of a Salesforce Search form based on a logged in user's Contact record or Account record.

This option for filtering records of a given object can apply to 1) the Contacts object itself; 2) the Accounts object itself; or 3) any object that is related to the Contact or Account object.

Filtering by Contact ID

To filter Salesforce Search results by Contact ID of the logged in user:

  • Go to Components > J!Salesforce Dashboard > Search
  • Click Form Manager
  • Open the form containing the records to which you wish to grant edit access
  • On the Search Form tab, click Add Salesforce Element
  • Select the Contact ID from the Saleforce Field drop down list
  • For Hidden, choose Yes
  • For Default Value, insert the following variable, matching the exact casing:

    {$ContactId}

  • Click Save

jsf-search-contact-filter.png

Filtering by Account ID

To filter Salesforce Search results by Account ID of the logged in user:

  • Go to Components > J!Salesforce Dashboard > Search
  • Click Form Manager
  • Open the form containing the records to which you wish to grant edit access
  • On the Search Form tab, click Add Salesforce Element
  • Select the Account ID from the Saleforce Field drop down list
  • For Hidden, choose Yes
  • For Default Value, insert the following variable, matching the exact casing:

    {$AccountId}

  • Click Save