< Return to the Knowledge Base Home Page
In some cases, you may want the Lookup fields in the Time Tracking (“Stopwatch”) component to default based on the record you are viewing. For example, when viewing an Opportunity record, the Opportunity Lookup field can automatically default into the secondary Lookup field in the component.
By adjusting the component’s properties in the Lightning App Builder, you can control which secondary Lookup shows in the component, as well as which Account record is defaulted into the Account field in the component. Let’s examine the component’s properties and see this in action.
The component contains two properties that can be populated via the Lightning App Builder:
Second Lookup Field, and
Account Default Value
Second Lookup Field controls which Lookup field is displayed in the component below the Account Lookup field. When you click on the Second Lookup Field field, all Lookup fields that exist on the Time Tracking Summary object are displayed. Select the Lookup field that looks up to the object whose Lightning Record Page the component is on. If we consider our first example where we want to see the Opportunity Lookup field displayed on an Opportunity record page, we would select the Lookup field that looks up to the Opportunity object. If you don’t see a Lookup field that looks up to the object to which you are adding the component, make sure that a Lookup field that looks up to that object exists on the Time Tracking Summary object.
Account Default Value controls which Account record is defaulted into the Account Lookup field in the component.
When the component is added to record pages on objects other than Account, choose a Lookup field from the record page's object. The value from the selected field on the current record is defaulted into the Account field in the component.
When the component is added to Account record pages, the current Account record is defaulted into the Account field in the component, regardless of the field selected in the Lightning App Builder.
When the component is added to Task record pages, if the Related To field is selected, the value of the Related To field is defaulted into the Account field in the component only if Related To on the Task record is populated with an Account record.