For the complete documentation index, see llms.txt. This page is also available as Markdown.

Show External Orders on a Salesforce Account Record Page

Use Salesforce Connect and two Avonni Data Tables to show an Account's external orders and load the matching line items when a rep selects an order.

External orders and order details on a Salesforce Account record

Build the project

Choose how you want to build:

✨ Build with AI — Give your AI assistant a ready-to-use prompt.

🛠️ Build it — Follow the steps yourself.

Use the Avonni Dynamic Components skill to draft the two linked Data Tables. Salesforce Connect supplies the external orders and line items.

1

Set up your assistant and sandbox

Follow Build with AI to install the Avonni Skills, connect the Avonni MCP server and sign in to your sandbox through Salesforce CLI.

Confirm that Salesforce Connect exposes the two external objects and that the order object can be related to Account.

2

Copy the prompt and review the plan

Paste the prompt into your configured assistant. Confirm the target org, field mappings and existing dependencies before approving the plan.

Prompt for this project
3

Deploy to the sandbox and check the result

Review what the assistant generated and what it left for you to configure. Deploy approved files only to your sandbox and use the Build it tab to finish any setup or wiring. Then run Test the Component with test data before activating or publishing to your users.

Open two sandbox Accounts with different orders. Select and clear an order on each and confirm the detail table switches to its line items and the placeholder returns on clear.

Connect the external orders in Salesforce

Before building in Avonni, you need two External Objects synced to Salesforce via Salesforce Connect.

External data source

External Objects and fields

  • Order (Order__x)

Name
Type

customerID__c

Indirect Lookup(Account)

DisplayUrl

URL(1000)

ExternalId

External Lookup

orderDate__c

Date/Time

orderID__c

Number(18, 0)

shippedDate__c

Date/Time

  • OrderDetails (OrderDetail__x)

Name

DisplayUrl

URL(1000)

ExternalId

External Lookup

orderID__c

External Lookup(Order)

orderLine__c

Number(18, 0)

product__c

Text(255)

quantity__c

Number(18, 0)

unitPrice__c

Number(10, 8)

Component Setup

You'll build a single dynamic component with two Data Tables arranged side by side. The first table lists orders for the current account. The second table reacts to the selected row and shows its line items.

spinner
1

Add a column component onto the canvas

  1. Set 2 fixed-width columns, each column will hold one data table for a clean and organized component

2

Configure the Orders data table

  1. Drag a data table into the left column

    1. Name = Datatable_ExtOrders. Use a clear name as it will be used to make the other components reactive.

  2. Create a query on the Order__x external object

  3. Set the filter to a custom text formula resource : F_QueryOrders

    1. Value : "customerID__r.Id = '" & {!$Component.RecordId} & "' "

    2. This will be read by the component as the criteria after the WHERE of the SOQL query

    3. This is necessary due to technical limitations around external object fields

  4. Map fields to columns according to business needs

  5. Set the maximum selectable rows to 1

  6. Customize the table's header

    1. Title = External Orders

    2. Icon = standard:work_order

3
  1. Create a query on the OrderDetail__x external object

  2. Set a filter to OrderID = Datatable_ExtOrders > First Selected Row SObject > ExternalId. This will make the component reactive to the selected record in the first data table.

  3. Map fields to columns according to business needs

  4. Hide the checkbox column

  5. Customize the table's header

    1. Title = Order Details

    2. Icon = standard:work_order_item

  6. Set a conditional visibility rule so that the table only display when the user selects a record

    1. Datatable_ExtOrders > Selected Rows Key value = is not empty

4

Add an Image component as a placeholder

  1. Enable show placeholder

  2. Placeholder message : Select an order to view products.

  3. Placeholder illustration : Gone fishing

  4. Set a conditional visibility rule so that the image only display no order records are selected

    1. Datatable_ExtOrders > Selected Rows Key value = is empty

5

Save and review

  • Make sure your component's target page object is Account


Test the Component

  • Open any Account record that has external orders.

  • The Orders table should load automatically and display the account's orders.

  • Click any row. The Order Details table on the right should update immediately with that order's line items.

  • If no orders appear, verify the customerID__c Indirect Lookup field maps correctly to the Account's Id and that the External Data Source sync is complete.

Open a second Account with different orders and confirm the first Account's orders are absent. Select an order, then clear the selection and check that the details table disappears and the selection prompt returns.


Watch the finished project

spinner

Going further

  • Add a Metric component above the Orders table to show the total number of open orders using a Formula resource.

  • Wire an Interaction on the Orders table row click to navigate to the order's DisplayUrl if your team needs to access the source system directly.

  • Apply Conditional Styling to flag orders where shippedDate__c is null as "Pending".

Dynamic components used in this use case

table-cellsData Tableimage-landscapeImageColumns

Last updated

Was this helpful?