実際に試す: Lightning ページを作成する
前述したように、XML ファイルとして Lightning ページを手動で作成する必要があります。この作業と次の作業には、XML エディタが必要です。
パッケージを抽出したときに作成された Salesforce1_Dev_Guide_Deliveries_App フォルダには、flexipages フォルダがあります。そのフォルダ内には、ここで作成する最終的な Lightning ページファイルのサンプルバージョン (参照用) があります。ただし、これから自分で Lightning ページを作成します。コーディングを始めましょう。
- 任意の XML エディタを開きます。
- 新しいファイルを開きます。
-
このコードブロックをコピーして XML エディタに貼り付けます。
1<?xml version="1.0" encoding="UTF-8"?> 2<FlexiPage xmlns="http://soap.sforce.com/2006/04/metadata"> 3 <flexiPageRegions> 4 <componentInstances> 5 <componentInstanceProperties> 6 <name>entityName</name> 7 <value>Delivery__c</value> 8 </componentInstanceProperties> 9 <componentInstanceProperties> 10 <name>filterName</name> 11 <value>Todays_Deliveries</value> 12 </componentInstanceProperties> 13 <componentName>flexipage:filterListCard</componentName> 14 </componentInstances> 15 <componentInstances> 16 <componentInstanceProperties> 17 <name>entityNames</name> 18 <value>Delivery__c,Return_Item__c</value> 19 </componentInstanceProperties> 20 <componentName>flexipage:recentItems</componentName> 21 </componentInstances> 22 <name>main</name> 23 </flexiPageRegions> 24 <masterLabel>Deliveries</masterLabel> 25</FlexiPage> -
ファイルを Deliveries.flexipage として flexipages フォルダに保存します。
基本的な Lightning ページを作成しましたが、別のコードブロック (Lightning ページに割り当てるアクションを指定するセクション) を追加する必要があります。XML はまだ完成していません。