Try It Out: Add an Action to Your Flexible Page

A global action called “New Delivery” for this Flexible Page is included in the sample app package you downloaded at the start of this chapter. We just need to call it in the XML.

  1. If it’s not already open, re-open the Deliveries.flexipage file in your XML editor.
  2. Add this action codeblock to the end of the XML, just before the </FlexiPage> tag.
    This codeblock associates the New Delivery action with the Flexible Page.
    1<quickActionList>
    2        <quickActionListItems>
    3            <quickActionName>New_Delivery</quickActionName>
    4        </quickActionListItems>
    5    </quickActionList>
  3. Save the Deliveries.flexipage file.
Now, when users open the Deliveries app from the Salesforce1 menu, the Flexible Page will have an action bar that they can tap to access this action.

Example

Your full codeblock should look like this:
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    <quickActionList>
26        <quickActionListItems>
27            <quickActionName>New_Delivery</quickActionName>
28        </quickActionListItems>
29    </quickActionList>
30</FlexiPage>

The XML code is ready. Now it’s time to deploy it, and the rest of the Deliveries package, into your organization.