Target Page Object
Last updated
Was this helpful?
Last updated
Was this helpful?
The Target Object API Name is a fundamental setting for your Avonni Dynamic Component. It establishes the primary Salesforce object that your component will interact with (e.g., Account
, Contact
, Opportunity
, My_Custom_Object__c
). It provides the essential data context for your component's operations and display.
You can define or update the Target Page Object for your Dynamic Component in two ways:
When you click "New" from the Avonni Components App home page to create a Dynamic Component, the initial setup dialog will include an option (often a dropdown list) labeled "Target Page Object".
Before you finalize the component's creation, select the desired Salesforce object from this list. This sets the initial context for your new component.
Open your Dynamic Component in the Component Builder.
Click the Settings icon (usually a gear ⚙️ located in the top-left corner of the builder).
In the settings panel that appears, locate the Target Page Object property.
Select or change the Salesforce object from the dropdown list.
Remember to Save your Dynamic Component after making changes here.
Setting the Target Object API Name correctly unlocks key data access features:
Provides Current Record Data (on Record Pages): This is crucial for components placed on Salesforce record pages. When the Target Page Name matches the object of the record page (e.g., you set it to Account
and place the component on an Account page):
The $Component.record
global variable automatically becomes available, giving you direct access to all field data of the current record being viewed. For example, you can display the record's name using $Component.record.Name
.
The current record's ID is also readily accessible, typically via $Component.record.Id
or by selecting the @recordId
option in the resource selector.
Simplifies Related Data Display: Knowing the primary object and having easy access to the current record's ID (via $Component.record.Id
or @recordId
) is essential for configuring queries or filters to display lists of related records (e.g., showing all Contacts related to the current Account)
Record Detail Pages: You will almost always set the Target Page Object when building components designed explicitly for record pages, as this is the primary way to access the current record's data.
Displaying Related Lists/Data: Whenever your component needs to display or interact with data related to a specific record viewed on a page.
Contextual Components: Any component whose behavior or displayed information must be contextualized to a specific record.
Master-Detail Relationships: When creating master-detail style relationships between components within your Dynamic Component (e.g., an Account list driving a related Contact list), the context provided by the Target Page Object for the overall page record can be a starting point
Standalone Components (No Record Context): If your component is entirely independent of any specific record and doesn't need to access record data directly (e.g., a generic calculator, a static informational panel, or a component on an App Page that displays org-wide summaries without a specific record focus), you might not need to set the Target Page Object. In these cases, you'd typically use the Avonni Query Data Source to fetch required data without relying on a page record context.
Thethe Target Page Object provides the crucial data context for your Dynamic Component, telling it which Salesforce object to work with primarily and, most importantly, which specific record's data should be readily available on record pages.
Enables the : Once set, the Fields tab in the Component Library (left panel) populates with all available fields from the selected object. You can then drag and drop those fields onto your canvas, automatically creating data-bound components.
Using Only Variables Initialized by Other Means: If all the record data your component needs is explicitly passed into it via input variables (e.g., when a component is launched in a modal or panel and receives a record ID as input, which then populates a local Record Variable via an "" action), you might not strictly need to set the overall Target Page Object, though it can still help populate the for easier layout design.