Newer Version Available
FlexiPage
Represents a Lightning page. A Lightning page is a
customizable page composed of regions containing Lightning components.
Includes access to the associated FlexiPage object in the Metadata API. Available from API version 31.0 or later.
Lightning pages are used in several places.
- In the Salesforce app, a Lightning page is the home page for an app that appears in the navigation menu.
- In Lightning Experience, Lightning pages can be used:
- To customize the layout of record pages, the Salesforce Home page, and the Email Application pane in the Outlook and Gmail integrations.
- As the home page for an app.
- As the utility bar for a Lightning app.
Supported SOAP Calls
create(), delete(), describeLayout(), describeSObjects(), query(), retrieve(), update(), upsert()
Supported REST HTTP Methods
GET, HEAD
Fields
Sample Code
This code sample creates a Lightning page with a single Recent Items component, that shows recently used Accounts and MyCustomObject__cs
1ComponentInstance recentItems = new ComponentInstance();
2 recentItems.setComponentName("flexipage:recentItems");
3 ComponentInstanceProperty cip = new ComponentInstanceProperty();
4 cip.setName("entityNames");
5 cip.setValue("Account,MyCustomObject__c");
6 recentItems.setComponentInstanceProperties(new ComponentInstanceProperty[]{cip});
7
8FlexiPageRegion mainRegion = new FlexiPageRegion();
9mainRegion.setName("main");
10mainRegion.setType(FlexiPageRegionType.Region)
11mainRegion.setComponentInstances(new ComponentInstance[] { recentItems });
12
13FlexiPageMetadata fpMetadata = new FlexiPageMetadata();
14fpMetadata.setFlexiPageRegions(new FlexiPageRegion[]{mainRegion});
15fpMetadata.setMasterLabel("My FlexiPage");
16fpMetadata.setDescription("A FlexiPage with a recent items component");
17fpMetadata.setType(FlexiPageType.AppPage);
18
19FlexiPage flexiPage = new FlexiPage();
20flexiPage.setFullName("MyFlexiPageDevName");
21flexiPage.setMetadata(fp);
22
23// Create
24SaveResult saveResult = soapConnection.create(new SObject[] { flexiPage });