Skip to end of banner
Go to start of banner

Part 2 - Building a table to display Salesforce Contacts

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

In this section we will build a table that displays Salesforce Contact data which can be filtered by Salesforce Account, selected by the user.

 

Source code

The following source code is shared using Confluence Storage Format, the XHTML-based format that Confluence uses to store the content of pages, page templates, blueprints, blog posts and comments.

For more information on how to use this source code on your Confluence, read the following article:


 Click here for the source code...
 <p class="auto-cursor-target">
  <br/>
</p>
<ac:structured-macro ac:macro-id="27383614-8004-485c-ab61-cd08d23dd0de" ac:name="report-table" ac:schema-version="1">
  <ac:parameter ac:name="injected">true</ac:parameter>
  <ac:rich-text-body>
    <p class="auto-cursor-target">
      <br/>
    </p>
    <ac:structured-macro ac:macro-id="55cbe342-8575-483b-a1c0-bf1b2c7299b1" ac:name="soql-reporter" ac:schema-version="1">
      <ac:parameter ac:name="query">Select Id,Account.Name, Name,Title,Email,Phone from Contact ORDER BY Account.Name, Name</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="df1371cc-21df-4500-88ac-ecbbc3030e19" ac:name="text-filter" ac:schema-version="1">
            <ac:parameter ac:name="contains">%data:AccountName>1%</ac:parameter>
            <ac:parameter ac:name="">sf:Account.Name</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p class="auto-cursor-target">
      <br/>
    </p>
    <ac:structured-macro ac:macro-id="dc53d519-e0a9-4105-b354-70afb90aea20" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Account Name</ac:parameter>
      <ac:rich-text-body>
        <p class="auto-cursor-target">
          <ac:structured-macro ac:macro-id="92f6aa94-b64a-492d-a611-8acdc9b752ab" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">sf:Account.Name</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p class="auto-cursor-target">
      <br/>
    </p>
    <ac:structured-macro ac:macro-id="c6007c06-8fb1-4ec4-abf7-908192ee33d9" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Contact Name</ac:parameter>
      <ac:rich-text-body>
        <p class="auto-cursor-target">
          <ac:structured-macro ac:macro-id="c5d23791-e17c-46bb-98aa-461fab09a6fc" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">sf:Name</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p class="auto-cursor-target">
      <br/>
    </p>
    <ac:structured-macro ac:macro-id="4ac2bf3f-b682-431e-8f3b-fe2db34344ae" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Title</ac:parameter>
      <ac:rich-text-body>
        <p> <ac:structured-macro ac:macro-id="e8315644-8314-4108-b8c8-433ee8301b84" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">sf:Title</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p class="auto-cursor-target">
      <br/>
    </p>
    <ac:structured-macro ac:macro-id="ae5e6fdc-b34b-4323-af68-0e4492dd945e" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Email</ac:parameter>
      <ac:rich-text-body>
        <p class="auto-cursor-target">
          <ac:structured-macro ac:macro-id="8c21f0e3-8b7c-4ffd-af51-89652ca54913" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">sf:Email</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p class="auto-cursor-target">
      <br/>
    </p>
    <ac:structured-macro ac:macro-id="53475e16-7e92-4df1-86a0-625a3da2b203" ac:name="report-column" ac:schema-version="1">
      <ac:parameter ac:name="title">Phone</ac:parameter>
      <ac:rich-text-body>
        <p>
          <ac:structured-macro ac:macro-id="ec988b1b-0f4e-452d-9177-f755c54b28eb" ac:name="report-info" ac:schema-version="1">
            <ac:parameter ac:name="">sf:Phone</ac:parameter>
          </ac:structured-macro>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p class="auto-cursor-target">
      <br/>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
  <br/>
</p>

Steps

  1. Add a Report Table macro and set its Injected parameter to "True".

  2. Within the Report Table macro, add a SOQL Reporter macro and set its Query parameter to "Select Id,Account.Name, Name,Title,Email,Phone from Contact ORDER BY Account.Name, Name".

  3. Within the SOQL Reporter macro, add a Text filter macro.
    Set its Key parameter to "sf:Account.Name"
    Set Contains Value parameter to "%data:AccountName>1%" respectively.

  4. Back within the Report Table macro, add five Report Column.
    Set their Titles to "Account Name", "Contact Name", "Title", "Email", and "Phone" respectively.

  5. Back within the Report Block, create a Report Body macro.

  6. In the "Account Name" Report Column macro, add a Report Info macro.
    Set the Key parameter to "sf:Account.Name"

  7. In the "Contact NameReport Column macro, add a Report Info macro.
    Set the Key parameter to 
    "sf:Name"

  8. In the "TitleReport Column macro, add a Report Info macro.
    Set the Key parameter to 
    "sf:Title"

  9. In the "EmailReport Column macro, add a Report Info macro.
    Set the Key parameter to 
    "sf:Email".

  10. In the "PhoneReport Column macro, add a Report Info macro.
    Set the Key parameter to 
    "sf:Phone".

Macro structure

  • No labels