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.

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.
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.
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
Name = OrderDB
Type = Salesforce Connect: OData 2.0
External Objects and fields
Order (Order__x)
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)
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.
Configure the Orders data table
Drag a data table into the left column
Name = Datatable_ExtOrders. Use a clear name as it will be used to make the other components reactive.
Create a query on the Order__x external object
Set the filter to a custom text formula resource :
F_QueryOrdersValue :
"customerID__r.Id = '" & {!$Component.RecordId} & "' "This will be read by the component as the criteria after the WHERE of the SOQL query
This is necessary due to technical limitations around external object fields
Map fields to columns according to business needs
Set the maximum selectable rows to 1
Customize the table's header
Title = External Orders
Icon =
standard:work_order
Configure the related Order Details data table
Create a query on the OrderDetail__x external object
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.Map fields to columns according to business needs
Hide the checkbox column
Customize the table's header
Title =
Order DetailsIcon =
standard:work_order_item
Set a conditional visibility rule so that the table only display when the user selects a record
Datatable_ExtOrders>Selected Rows Key value= is not empty
Add an Image component as a placeholder
Enable show placeholder
Placeholder message : Select an order to view products.
Placeholder illustration : Gone fishing
Set a conditional visibility rule so that the image only display no order records are selected
Datatable_ExtOrders > Selected Rows Key value= is empty
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__cIndirect 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
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
DisplayUrlif your team needs to access the source system directly.Apply Conditional Styling to flag orders where
shippedDate__cis null as "Pending".
Dynamic components used in this use case
Last updated
Was this helpful?
