force:navigateToRelatedList
関連リストに移動するには、parentRecordId 属性で親レコード ID を設定し、イベントを起動します。たとえば、取引先責任者オブジェクトの関連リストを表示する場合、parentRecordId は Contact.Id です。次の例では、取引先責任者レコードの関連ケースを表示します。
1gotoRelatedList : function (component, event, helper) {
2 var relatedListEvent = $A.get("e.force:navigateToRelatedList");
3 relatedListEvent.setParams({
4 "relatedListId": "Cases",
5 "parentRecordId": component.get("v.contact.Id")
6 });
7 relatedListEvent.fire();
8}| 属性名 | 型 | 説明 |
|---|---|---|
| parentRecordId | String | 必須。親レコードの ID。 |
| relatedListId | String | 必須。表示する関連リストの API 名 (「Contacts」や「Opportunities」など)。 |