Skip to Content

Create A Sales Order Push Card

test
0 %
Create A Sales Order Push Card
Details

Create A Sales Order Push Card

August 12, 2021
Created by
August 16, 2020
Create a single instance card with actions that allows you to send the card by triggering a push notification from an external system.

You will learn

  • How to modify the card type to single instance in Business Application Studio
  • How to add subscription parameters to SAP Mobile cards
  • How to deploy and publish a card to SAP Mobile Services from Business Application Studio
QR code


Step 1: Understand the use case

Watson is a salesperson who has created a Sales Order.

Alice is the sales manager who needs to approve this request. However, Alice has 20 salespeople reporting to her. Thus, she wants to be immediately notified when a new request is created.

Log on to answer question
Step 2: Create Sales Order Approval Card using a template
  1. Open Business Application Studio and enter your dev workspace.

    Business Application Studio Dashboard
  2. In the menu bar, go to View → Find Command, click Find Command.

    Open Command Pallete

    For faster development, you can use the shortcut keys mentioned in the menu item.

  3. Search for Mobile Cards and select Mobile Cards: New From Template.

    Command Pallete New Card
  4. Select Sales Order Approval Card - Multi Instance.

    Sales Order Card Menu Item
  5. Enter a name for the card; e.g. Sales Push Card BAS.

    Enter a name for the card
  6. A folder called Sales Push Card BAS is created.

    Card Structure
Log on to answer question
Step 3: Modify card type
  1. In your File Explorer, right click on metadata.json, and select Open With → Code Editor.

    Metadata.json Open With

    Click here to learn more about editing a card in Business Application Studio

  2. Replace the CustomType attribute:

    Old Value New Value
    Query SingleInstance
    Custom Type Replace Image
  3. In your File Explorer, click metadata.json, and notice the Card Template in the Info tab.

    Metadata.json Metadata Editor
What is the CustomType of the card used? (Note: The answer is case sensitive.)
×
Step 4: Add a subscription parameter
  1. In the metadata.json file, open URLs tab.

    URLs Tab
  2. Delete the SalesOrderId parameter in the Parameters table.

    Delete SalesOrderId Parameter
  3. In the Subscription Parameter table, add a new subscription.

    Add Subscription Parameter

    Click here to learn more about Subscription Parameters in SAP Mobile Cards.

  4. Add the following details to create a new Subscription Parameter: SalesOrderID.

    Field Name Value
    Name SalesOrderID
    Label Sales Order ID
    Data Type Edm.String
    Maximum Length 255
    New Subscription Parameter
  5. In the Data Endpoint URL tab, replace the old URLs with the following:

    URL Type URL Destination
    0 /SalesOrderHeaders(%27${SalesOrderID}%27)?$expand=CustomerDetails Optional, not set
    1 /SalesOrderItems?$filter=SalesOrderId%20eq%20%27${SalesOrderID}%27&$expand=ProductDetails Optional, not set
    New Subscription Parameter
Log on to answer question
Step 5: Deploy and publish card
  1. Open Find Command, search for mobile cards and select Mobile Cards: Deploy.

    Deploy Command
  2. Select the card you have created; e.g. Sales Push Card BAS.

    Deploy Card
  3. Upon successful deployment, you will see a toast message at the bottom right corner of your screen.

    Deploy success toast message
  4. Open Find Command, search for mobile cards and select Mobile Cards: Publish.

    Publish Command
  5. Select the card you have created; e.g. Sales Push Card BAS.

    Publish Card
  6. Upon successful publish, you will see a toast message at the bottom right corner of your screen.

    Publish success toast message
Log on to answer question

Congratulations! You have created a card type that can now add cards to your device through push notification upon a request made from an external system.

Click here to see how you can trigger a request from an external system.


Next Steps

Back to top