---
schema_version: "1"
id: a3adbc21b6b535d3f4d2c4823608a9dd15029b446c8ae536548f9fa7d59d2ca0
title: setCurrentByPKey(PKey, mode)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/cg_modeler_listobject_set_current_pkey.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.cg_modeler_listobject_set_current_pkey.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 93b1989d34920338c99e8f5ecf04364682723c2c19c83bf905c47427a42d3c47
description: Selects an element of the list. If the selection happens after adding an item, the mode parameter is used to notify the framework. This is required for certain master detail scenarios on phones where the added item detail must be shown.
products:
  - Consumer Goods
release: "264"
---
# setCurrentByPKey(PKey, mode)

Selects an element of the list. If the selection happens after adding an item, the mode parameter is used to notify the framework. This is required for certain master detail scenarios on phones where the added item detail must be shown.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience in <strong>Professional</strong>, <strong>Unlimited</strong>, and <strong>Enterprise</strong> Editions that have Consumer Goods Cloud enabled.</td></tr></tbody></table>

## Parameters

- PKey: The primary key of the item to select.
- mode: Enum. Flag that is used to identify whether the selection happens while adding an item (ListModel.currentChangedMode.ADD).