Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This exercise is based around a parcel delivery service Apollo Parcels. When parcels cannot be delivered, customers can request redelivery on a certain date, and give a target redelivery time.

Sorry, we tried to deliver a parcel but you were out.
Delivery Date 03/08/2014 .
Delivery Time 12-48 .
What would you like us to do? Please select an option below and post this form back to us
Take parcel back to distribution centre: __
Redeliver: __
On Date: _________________
Target Time: _________________
Return to sender: __

Image Added

Anchor
_Toc402702635
_Toc402702635
Anchor
_Toc442889166
_Toc442889166
Action to open another dashboard – filtered for selected row

...

  • Create a dashboard Apollo Manage Redeliveries
    • Drag the view Apollo Deliveries on to the dashboard
    • Press Press Image Modified to show all buttons
    • Press Press Image Modified to show the view details on the dashboard
      • Update the Element Name to: ApolloDeliveries
      • Press Press Image ModifiedPress
      • Press Image Modified
    • Resize your view on the dashboard, and press press Image Modified to save your layout changes
  • Create a dashboard Apollo Delivery Slots
    • Drag the view Apollo Deliveries Slots on to the dashboard
    • Press Image Removed Press Image Added to show all buttons
    • Press Image Removed Press Image Added to show the view details on the dashboard
      • Update the Element Name to: ApolloDeliverySlots
      • Press Image Removed
      • Press Image RemovedPress Image Added
      • Press Image Added
    • Resize your view on the dashboard, and press Image Removed press Image Added to save your layout changes

...

  • Open the configuration form for the Stream Apollo Deliveries

Go to the Actions tab

  • Press Press Image Modified to create a new action
  • Give the action the following configuration:
    • Name: Review Redelivery Slots
    • Display Name: Review Redelivery Slots
    • Open Post Dashboard: Apollo Delivery SlotsPress
  • Press Image Modified
  • Add context parameters to the action:
    • Go to the Context Parameters tab
    • Press Image RemovedPress Image Added
    • Configure a context parameter with the settings:
      • Name: DeliveryZone
      • Expression: ApolloDeliveries.DeliveryZone
        • Note that to reference the selected row, we use the Element Name of the view on the dashboardPress
      • Press Image Modified
      • Configure another context parameter:
        • Name: RedeliveryDate
        • Expression: ApolloDeliveries.RedeliveryDate
        • Press Image Removed
      Press Image Removed
        • Press Image Added
      • Press Image Added in the main Action configuration form
    • To associate the action with the view:
      • Open the configuration form for the view Apollo Deliveries
        • Go to the Menu tab
        Press
        • Press Image Modified - Actions
        • Select your action from the list and drag it into the list of actions associated with the view
        Press Image Removed
        • Press Image Added to apply your changes

You have configured the action Review Redelivery Slots to pop up another dashboard when it runs - Apollo Delivery Slots. Now you will add a filter to Apollo Delivery Slots so that it only shows entries relevant for the customer's details (delivery zone and redelivery date):

  • Open the view Apollo Delivery Slots from the Stream Apollo Delivery Slots (to see the data)
  • Add a filter:
    • Name: for Customer Details
    • Conditions:
      • Where ALL the following are true
      • DeliveryZone equals _context.DeliveryZone
        • Press the ABC button - this will now say fx
      • DeliverySlotDate equals _context.RedeliveryDate
        • Press the ABC button - this will now say fx
      Press Image Removed
    • Press Image Added
    • All records in the view will disappear – this is because there is currently no context set
  • Make this the default filter for the view:
    • Open the configuration form for the view – remember that you can do this by right-clicking on any data record and selecting Show View (you will have to remove the filter you just added to do this)
    • Go to the Advanced tab
    • Set Default Filter to: for Customer Details
    • Press Image RemovedPress Image Added

Now test the new action:

...

  • Go to the Stream Apollo Deliveries
  • Open the configuration form for the action Review Redelivery Slots
  • Go to the Validate Action tab
  • Enter the expression:
Code Block
if (ApolloDeliveries.DeliveryStatus != "REQ REDELIVERY",

...


 error("Not a redelivery request")

...


 )
  • Press Image RemovedPress Image Added
  • Try running your action again – both on rows which are redelivery requests, and rows which are not - you should see the error appear when the row is not a redelivery request

...

  • Open the dashboard Apollo Delivery Slots
  • In the view Apollo Delivery Slots, press press Image Modified
  • Press - this opens the configuration of the stream behind the view
  • Go to the Actions tab
  • Add an action:
    • Name: Choose
    • Display Name: Choose Delivery Slot
    • Go to the Item Updates tab
    • Set Stream Item Action to Update
    • Press Press Image Modified
    • Press Press Image Modified and drag the attribute RedeliveryRef into the list of Action Attributes

...