Creating an SFDC Query

To create an SFDC query, create an SFDC Query object then link it to an SFDC Credentials object, to ensure the necessary login/authorization credentials are always available when the query is run.

  1. Navigate to   > Settings > Labs.
  2. In the SFDC Query area, click Manage.
  3. In the SFDC Queries page, go to the Queries tab in the left sidebar.
  4. Click Create SFDC Query.
  5. In New SFDC Query, complete this information as required:

    Parameter Type Description
    Name Text The internal name for the SFDC query.
    Active Toggle

    Whether the SFDC Query is in use, and is actively pulling data from Salesforce. We recommend waiting to activate the query until you’ve entered all the necessary information.

    The Active toggle must be enabled to to test the SFDC Query.

    If the toggle is inactive, the SFDC Query will not return results.

    Credentials Dropdown Select the Credentials object that defines the login/authorization information for your Salesforce account.
    Scope Configuration Select

    Define if the platform should filter query results at runtime. This can protect against cross-partner data exposure without relying solely on the WHERE clause in the query.

    Choose one of these scope modes:

    • Scoped (default) - query results are limited to the authenticated partner's data

      A WHERE filter is injected at runtime using the SFDC Scope Field and Scope Value (Merge Variable) configured in the query. This is the safe default for any partner-facing query - the platform adds the partner filter as an AND condition, so cross-partner exposure is prevented regardless of the WHERE clause in the query.

    • No scoping - no partner data filter; cross‑partner visibility is possible.

      The query runs exactly as authored with no partner or user restrictions applied by the platform.

      Warning

      Use this option only when results genuinely need to span multiple partners (e.g. internal dashboards visible only to Unifyr staff or super-admins)

    SFDC SOQL Query Code

    The partner merge fields to use in the code. These merge fields will  pull in the relevant partner data from SFDC into the partner portal for each partner.

    Important

    Aside from the merge fields, the rest of the SOQL query is taken from your organization’s SFDC account. Consult your Salesforce administrator for questions about retrieving the necessary SOQL query.

    For information about the merge fields supported by Unifyr One, see Which Partner Merge Fields does Unifyr One support?.

    For an example of a valid SFDC SOQL Query, see the Sample SFDC SOQL Query section of this article.

    Template Code

    The code that determines the formatting of the raw SFDC Query data when delivered to the partner portal.

    This is an Angular template that will render in the portal. There is a variable in scope called `queryResults` and `queryResults.list` could be used to access the list of elements in the query.

    Here, you can add options to sort the data by columns or export when the data is rendered on the partner portal.

    For an example of a valid template, see the Sample Template section of this article.

  6. Click Save to save the new query. You must test it before you can publish it to partners. For more information, see Testing an SFDC Query from the Editor and Testing an SFDC Query from a Custom Page.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.