Develop Secure Code
ui*Api Supported Objects
createListInfo
deleteListInfo
getListInfoByName
getListInfosByName
getListInfosByObjectName
getListObjectInfo
getListPreferences
getListRecordsByName
updateListInfoByName
updateListPreferences
updateListInfoByNameUse this wire adapter to update a list view’s metadata.
1import { updateListInfoByName } from "lightning/uiListsApi";
2import ACCOUNT_OBJECT from "@salesforce/schema/Account";
3
4updateListInfoByName({
5 objectApiName: ACCOUNT_OBJECT,
6 listViewApiName: "MyAccountListView",
7 label: "NewListViewLabel",
8});1PATCH /ui-api/list-info/${objectApiName}/${listViewApiName}See Update List View Metadata.
| Parameter Name | Type | Description | Required? |
|---|---|---|---|
objectApiName | String | The API name of a supported object. | ![]() |
listViewApiName | String | The API name of a list view, such as AllAccounts. | ![]() |
displayColumns | String[] | The display columns (field API names) for the list. | |
filterLogicString | String | The filter logic string, such as (1 OR 2) and 3. Indexes start with 1. | |
filteredByInfo | Object | Filtering information for the list. Type List Filter By Info Input[]. | |
label | String | The list’s display label. For example, All Accounts. | |
listShares | String[] | Objects the list is shared with, if visibility is set to Shared. | |
scope | Object | The scope information for the list. See List Scope Input. | |
visibility | String | The list’s visibility. Valid values are:
|
data—List Infoerror–FetchResponseThis code example updates the list view’s label on the button click.
1<!-- wireUpdateListInfoByName.html -->
2<template>
3 <lightning-card title="wireUpdateListInfo">
4 <lightning-button variant="brand" label="Update List View" title="Primary action" onclick={updateListView} class="slds-m-left_x-small"></lightning-button>
5 <template lwc:if={label}>
6 <div class="slds-m-around_medium">
7 <p key={label}>New ListView Label: {label}</p>
8 </div>
9 </template>
10 </lightning-card>
11</template>1// wireUpdateListInfoByName.js
2import { updateListInfoByName } from "lightning/uiListsApi";
3import { LightningElement, api } from "lwc";
4import ACCOUNT_OBJECT from "@salesforce/schema/Account";
5export default class UpdateListInfo extends LightningElement {
6 error;
7 label;
8 @api async updateListView() {
9 updateListInfoByName({
10 objectApiName: ACCOUNT_OBJECT.objectApiName,
11 listViewApiName: "AllAccounts",
12 label: "New Label",
13 })
14 .then((result) => {
15 this.label = result.data.label;
16 })
17 .catch((error) => {
18 this.error = error;
19 });
20 }
21}See Also