Adding Parameters to Mobile Actions

In a custom mobile process, you can set up parameters for RESTlets within specific types of mobile actions. You can also set up parameters when you add specific custom page elements to standard mobile processes using RESTlets. You can add input parameters to pass data from the mobile app to a RESTlet. You can also add output parameters to obtain and store a RESTlet’s response to the mobile state.

On the Mobile - Action page, you can set up or modify your parameters. When you add parameters, you define the data source and where you want to pass or store the data. For setup guidelines, see the following topics:

For instructions on how to access the Mobile - Action page, see the following topics:

Input Parameters for Navigation

For the Page Navigation, Forward Form, and Submit Form action types, add an input parameter that specifies the target page. On the Input Parameter subtab of the Mobile - Action page, tap New Mobile – Input Parameter. On the Mobile – Input Parameter page, enter values in the following fields:

  • Name – Enter a unique name for the input parameter.

  • Key – Enter page_id, the key used in standard RESTlets for the target page.

  • Value – Enter the target page using keywords and the page name as follows:

    • For standard mobile pages, enter constant:page_<page name>

      Example: constant:page_NSWMS_Main_Menu

    • For custom mobile pages, enter constant:custom_page_<page name>

      Example: constant:custom_page_poReceiving_selectPOFromList

To set up these mobile action types, see Customizing Mobile Actions.

Input Parameters for Data Validation, Storage, or Submission

Standard mobile processes use input parameters for RESTlets in Forward Form and Submit Form types of mobile actions. These actions pass mobile app data to RESTlets that validate them, store them in a state, or submit them to NetSuite transactions or records. You can find them in On Click Action events of a button element or On Select Action events of a table or list.

Within your custom mobile processes, you can add input parameters to pass additional details by specifying the data source. On the Input Parameter subtab of the Mobile - Action page, tap New Mobile – Input Parameter. On the Mobile – Input Parameter page, enter values in the following fields:

  • Name – Enter a unique name for the input parameter.

  • Key – Enter the name of the key or page element that serves as your data source.

  • Value – Enter a constant to specify the value of the key, or a path to a source key or page element.

    If you want to include an API call, using getSourceData() or getValue(), to obtain data from a page element, see Mobile Page Element APIs.

Examples:

Sample Key

Value Format

Sample Value

customerId

warehouseLocationId

State key path –

state:dataRecord:<state object><state key>

state:dataRecord:scriptParams:customerId

state:dataRecord:auxParams:warehouseLocation_LocationTbl:id

For more information, see Accessing Data Stored in the State.

binName

Page element path –

page:<page name>:<page element name>

page:poReceiving_enterBin_binListTbl:binName

selectedLotNumber

Popup page element path –

popup:<element name>

popup:enterLot_lotTbl

transactionType

Constant –

constant:<value>

constant:purchaseorder

stagingBins

Page element path with API call – page:<page element name>:<function>()

page:stagingbin_binstbl:getSourceData()

To set up these mobile action types, see Customizing Mobile Actions.

Output Parameter Settings

You can add an output parameter to obtain the RESTlet’s response and store it in a mobile state. To set it up, map the response key to the state key. On the Output Parameters subtab of the Mobile - Action page, click New Mobile – Output Parameter. On the Mobile – Output Parameter page, enter values in the following fields:

  • Name – Enter a unique name for the output parameter.

  • Response Key – Enter the keyword, response, followed by the key in the RESTlet that contains the response data.

  • Destination Key – Enter the key in the state to which you want to store the response data.

    You can include an API call to set values in page elements based on data returned by the RESTlet or perform a task like refreshElement(). You can enter it using the following format: page:<page element name>:<function>(). For more information, see Mobile Page Element APIs.

Examples:

Sample Response Key

Sample Destination Key

response:inforemainingQuantity

inforemainingQuantity

response:itemInternalId

itemInternalId

response:transactionType

transactionType

response:binTransferObj

binTransferObj

response:selectResponse

page:stagingbin_binstbl:select()

response

page:packItems_itemsTbl:updateData()

To add output parameters for Print button actions, see Setting Up Print Button Actions.

Related Topics

General Notices