Setting Up Print Button Actions
Print action setup applies to the following scenarios:
-
After you add or modify a print button, you can set up the mobile actions that perform the printing tasks.
-
After you create a custom print report for label or document, you can assign it to the action of the Print button. Depending on your printing requirements, you can also assign it a standard print report.
When you tap a print button, the app calls the main print action to print your labels and documents. This main action contains additional actions that perform specific printing tasks. Refer to the following sequence of actions and tasks.
-
Print action – The main print action contains the list of print reports and their settings, including automatic printing, required printing, and print references. For print reports that are set to manual printing, it displays the Print popup window on which you can specify your printing options. To perform additional printing tasks, it calls the Before Print action and, for each print report, the Get Print File Path action. Then, it submits the print request to your local printer through PrintNode.
The Print action is set up in the On Click Action field of the Action Button element. If you create custom print reports for your custom print templates, add them to the Print action.
-
Before Print action – This mobile action contains the RESTlet that retrieves and stores data required for labels, documents, and printing rules associated with the print reports.
The standard Before Print action includes input and output parameters for data captured from mobile pages. It saves the data in an instance of the source record, which is used by the template associated with the print report. The data can also be used for printing rules that you set up on a print report. It stores the ID of the source record instance in the state to make it available for the Get Print File Path action.
Note:Set up input parameters if you use the User Field fields of a standard source record for your custom templates or printing rules. Map each of these fields to an input parameter and set them up to retrieve the required data. For more information about the User Field fields of standard source records, see Showing Data on Custom Labels or Documents.
As part of the Print action settings, this mobile action is set up in the Before Print Action field.
-
Get Print File Path action – This mobile action contains the RESTlet that generates and stores the label associated with a print report. Based on the template you select on the Print popup window, it chooses which data to use from those retrieved by the Before Print action. It provides the file cabinet path to the folder that stores the generated label. The Print action submits this path, along with your print request.
As part of the Print action settings, this mobile action is set up in the Get Print File Path Action field for each print report.
For more information about print reports, see Setting Up Printing Settings on Print Reports.
Standard Actions for Mobile Printing
When you add your print button, you can set up the mobile actions for printing or create mobile actions based on your printing requirements. You can refer to following tables that contain the list of standard Print and Before Print actions for NetSuite WMS and Ship Central.
Warehouse Management Process |
Print Report Type |
Print Action Name (On Click Action) |
RESTlet Action Name (Before Print Action) |
---|---|---|---|
Purchase order receiving |
Item & pallet label |
Regular items: poReceiving_ Lot items: poReceiving_ Serialized items: poReceiving_ |
poReceiving_beforePrintActn |
Inbound shipment receiving |
Item & pallet label |
Regular & lot items: inbShipmentRec_ Serialized items: inbShipmentRec_ |
inbShipmentRec_ |
Work order assembly picking |
Item & pallet label |
Regular items: wo Lot items: woAssemblylotScan_ Serialized items: wo |
woAssembly_beforePrintActn |
Single sales order picking * |
Pick carton label |
singleOrderPicking_ |
single |
Single transfer order picking * |
Pick carton label |
singleOrderPicking_ |
single |
Multi-order picking * |
Pick carton label |
mp_ |
multi |
* Pick carton label printing is set up as a sub-action of an Action Sequence type of action. This action sequence is called from the On Click Action of the Enter Carton button on the Enter Carton mobile page. For more information about this page, refer to the table under Setting Up Automatic or Required Printing. |
Ship Central Process |
Print Report Type |
Print Action Name (On Click Action) |
RESTlet Action Name (Before Print Action) |
---|---|---|---|
Sales order packing |
Carton label |
onLoadSOAddCarton_printLabelAction |
Print Insert data |
Ship As Is item: salesOrder_printCartonForShipAsIs |
SalesOrder_ |
||
Carton list & BOL report |
salesOrder_printCartonList |
sales |
|
Pallet label |
addPallet_printLabelAction |
print pallet insert data |
|
Pallet list & BOL report |
salesOrder_printPalletList |
sales |
|
Transfer order packing |
Carton label |
onLoadTOAddCarton_printLabelAction |
Print TO Insert Data |
Ship As Is item: transferOrder_printCartonForShipAsIs |
transferOrder_ |
||
Carton list & BOL report |
transferOrder_printCartonList |
transfer |
|
Pallet label |
addPallet_printPalletAction |
Print TO Pallet Insert Data |
|
Pallet list & BOL report |
transferOrder_printPalletList |
transfer |
|
Sales order shipping |
Ship Label Report |
Action Sequence Name (On Click Action) -ShipCentral_ Sub-action Name -confirmAddressAndPrint_ Print Action Name -shipPackages_ |
shipLabelPrint |
Action Sequence Name (On Click Action) -ShipCentral_ Sub-action Name -confirmAddressAndPrintShip_ Print Action Name -shippackage_print |
|||
Return Label Report (SO) |
Action Sequence Name (On Click Action) -print_returnlabelValidation Sub-action Name -PrintReturnLabel Print Action Name -print_returnlabel |
||
Certificate of Origin |
Action Sequence Name (On Click Action) -PrintLabel_FormDownload Sub-action Name -printForm_printAction Print Action Name -print_form_download |
||
Transfer order shipping |
TO Ship Label Report |
Action Sequence Name (On Click Action) -ShipCentral_ Sub-action Name -TOconfirmAddressAndPrint_ Print Action Name -TOshipPackages_ |
TOshipLabelPrint |
Action Sequence Name (On Click Action) -TOShipCentral_ Sub-action Name -TOconfirm Print Action Name -toshippackage_print |
|||
Return Label Report (TO) |
Action Sequence Name (On Click Action) -TOValidprint_returnLabel Sub-action Name -TOPrintReturnLabel Print Action Name -TOprint_returnLabel |
shipLabelPrint |
|
Certificate of Origin |
Action Sequence Name (On Click Action) -TO_PrintLabel_FormDownload Sub-action Name -to_printForm_action Print Action Name -to_print_form_action |
Print Action Setup on Other Buttons
The Print action is usually preconfigured in the On Click Action of the Print button. It can be set up on another button that may already have a different main action. For this case, the On Click Action of the button may call an Action Sequence type of action. The Print action can be set up in one of the sub-actions of the action sequence, along with the button’s main action. Examples of this setup include the Ship Central shipping processes, as well as the WMS order picking processes that support carton label printing. For more information about action sequences, see Mobile Action Sequence.
To set up print button actions:
-
Access the custom mobile page on which you want to add the print button by doing the following:
-
Go to Setup > Custom > Mobile Applications.
-
From the Mobile -Applications List, click View next to the mobile app.
-
From the Mobile -Process List, click View next to the custom mobile process.
-
On the Mobile -Process page, click the Pages subtab, and then click the name of the mobile page.
Tip:If you want to update the settings of a standard print button within your custom mobile process, see Setting Up Automatic or Required Printing for the table of standard page and print button names.
-
-
click the Page Elements subtab, and then click Edit next to the name of the print button.
-
Name – Enter a unique name for the button element.
-
Type – For a new print button, select Action Button.
-
Label – Select the button label you want to appear on the custom mobile page.
Tip:Tip: To add a label, click the plus icon.
-
-
On the Mobile -Page Element page, in the On Click Action field, do the following:
-
Select an existing Print type of mobile action or click the plus icon to add one.
-
If you select an existing action, click the open icon to edit it.
The Mobile -Action page appears.
To view the possible configurations for the other element settings for the Action Button, refer to the tables in Configuring Mobile Page Elements.
-
-
For new mobile actions, in the Type field, select Print.
-
On the Print Reports subtab, to add a new print report, click New Mobile -Print Reports, and then on the Mobile -Print Report page, do the following:
Note:Complete the following steps to add or edit print reports, as well as set it up for automatic or required printing. You can also set up your own label references used for reprinting. If you only want to set up input parameters for the User Field fields used in your custom print templates, you can skip this step and proceed to Step 6.
-
In the Report Type field, select the print report associated with the label or document you want to print.
Add each custom print report that you create for your custom print templates.
-
In the Source Row ID field, enter the internal ID or its path for the source record instance that stores the data used in the print template and rules associated with the print report.
The default setting for this field retrieves a dynamic value from the state. It specifies the state path to the key for the internal ID, called sourceId, of the source record instance, as follows:
Default setting: {{state:dataRecord:scriptParams:sourceId}}
If you use a standard source record, you can also use the default setting.
To specify a static value, you can refer to the list of record instances for your source record to get the internal ID. If you use a saved search as your source, you can refer to the results that contain the list of sublist instances.
-
In the Get Print File Path Action field, select a RESTlet type of mobile action.
If you want to use a standard RESTlet action, refer to the following table.
Label or Document
Standard Get Print File Path Action
WMS labels and documents
wms_invokePrint_Action
Ship Central packing labels and documents
Packship_invokePrint_Action
Ship Central shipping labels (SO and TO)
Ship Print Invoke Action
Ship Central return labels (SO)
Return Ship Print Invoke Action
Ship Central return labels (TO)
TO Return Ship Print Invoke Action
Ship Central certificate of origin and commercial invoice (SO)
Form Ship Print Invoke Action
Ship Central certificate of origin and commercial invoice (TO)
TO Form Ship Print Invoke Action
For more information about this action, see Setting Up Print Button Actions.
If you want to create your own RESTlet for this field, note that you can generate multiple document files at the same time from a single print report. In this case, you must set up the RESTlet’s response to return an array of file paths.
For example, when you print a carton list in Ship Central, this RESTlet generates multiple labels, one for each carton.
By default, using the same key in the Source Row ID field setting, the RESTlet returns the file path or array of file paths to the state.
-
If you want to set the print report to automatic printing, check the Automatic box.
-
If you want to set the print report to required printing, check the Required box.
-
In the Print Sequence field, enter the number for the print report’s position in the print sequence.
The Print action follows the print sequence when you associate multiple print reports to a single print button.
-
If you want to associate references to a label, you can set the following fields:
Note:Reference fields are used to search for and identify a printed label that you want to reprint. By default, print references include transaction numbers, items, serial or lot numbers, or cartons, depending on the data used within the mobile process. When you reprint, you can search for a label by any of these references.
-
Print Reference – Enter the number or ID for the print reference, which could pertain to the transaction, item, carton, and pallet among others.
To set up a dynamic value, you can enter the page, popup window, or state path to the key that contains the print reference value. In the following example, the transaction name or number stored in the state is set up as the print reference:
{{state:dataRecord:scriptParams:transactionName}}
-
Item – The name or number of the item on the printed label.
To set up a dynamic value, you can enter the page, popup window, or state path to the key that contains the item name or number. In the following example, the item name or number stored in the state is set up as the reference:
{{state:dataRecord:scriptParams:fetcheditemname}}
-
Lot # or Serial # -The lot or serial number of the item on the printed label.
To set up a dynamic value, you can enter the page, popup window, or state path to the key that contains the lot or serial number. In the following example, the lot or serial number stored in the state is set up as the reference:
{{state:dataRecord:scriptParams:lotorserialnumber}}
-
-
-
In the Before Print Action field, do the following:
-
Select an existing Restlet type of mobile action or click the plus icon to add one.
-
If you select an existing action, click the open icon to edit it.
The Mobile -Action page appears.
-
-
To set up the RESTlet for the Before Print action, set values in the following fields:
-
Name – Enter a unique name for the mobile action.
-
Type – Select Restlet.
-
HTTP Method – Select POST.
-
Script ID – Enter the ID of the RESTlet script you want to assign to this action.
If you want to use a standard script, enter customscript_autoprint_insertdata for Warehouse Management or customscript_packship_rl_save_print_data for Ship Central.
-
Deployment ID – Enter the ID of the RESTlet’s script deployment.
If you want to use a standard script deployment, enter customdeploy_autoprint_insertdata for Warehouse Management or customdeploy_packship_rl_save_print_data for Ship Central.
-
Convert Response to Object – If you want to set up a standard Before Print action, check this box to convert the RESTlet's response into an object.
-
-
On the Input Parameters subtab, set up your source fields, including any User Field fields used in your custom print templates, by doing the following:
-
Click New Mobile -Input Parameter.
-
In the Name field, enter a unique name for your parameter.
-
In the Key and Value fields, set up the data source for a field that you use in your print template.
Sources from the mobile app could be the mobile state, a mobile page, or a popup window. You can also set up a constant value. Refer to the following table for guidance and examples of standard input parameters:
Data to Retrieve
Standard Key
Standard Value Setting
Item name or number
Item
state:dataRecord:scriptParams:fetcheditemid
Serial Number field value
serialNumber
page:poReceiving_enterSerial_scanSerialTxt
Units field value
qtyUomSelection
page:
poReceiving_enterLotQuantity_enterQtyUOM:selection Quantity field value
Quantity
page:
poReceiving_enterLotQuantity_enterQtyUOM:custom:value Serialized item quantity
serialQuantity
constant:1
-
In the Resolution Order field, enter the number that indicates the position of this parameter in the resolution order. This field is optional, except if you set up multiple input parameters for the same key. In this case, you must define the priority by assigning a resolution order to each parameter.
The Before Print action follows the resolution order when evaluating multiple parameters.
-
(Optional) In the Condition field, enter the expression you want the Before Print Action to use to determine whether it can evaluate this parameter.
A parameter is evaluated if this expression results to true or if you do not specify a condition.
-
Click Save.
Repeat this step to add more input parameters.
-
-
On the Output Parameters subtab, set up the RESTlet’s response by do the following:
Note:The standard RESTlet’s response contains the retrieved data for your print template. Based on the Convert Response to Object setting in Step 7, it is stored as an object in the state. Standard Before Print actions contain one output parameter for this response.
-
Click New Mobile -Output Parameter.
-
In the Name Field, enter a unique name for your parameter.
-
In the Response Key and Destination Key fields, set up the source and destination for the retrieved data, as follows:
-
For the Response Key, enter the required keyword, response:, followed by the source of the data you want to include in the RESTlet’s response. By default, this field contains the key for the source record ID.
-
For the Destination Key, enter the key or field in which you want to store the data from the response key. By default, this field contains the key in the state in which the RESTlet stores the retrieved data converted into an object.
Tip:The standard destination keys are also used in the source row ID settings of the print reports. See Step 5.b.
Refer to the following table of standard response and destination key settings:
Print Report Type
Standard Response Key
Standard Destination Key
Warehouse Management & Ship Central:
Item, carton, & pallet label
response:id
sourceId
Ship Central:
BOL report
response:bolArr
bolArr
Carton & pallet list *
response:groupsRecordIdArr
groupsRecordIdArr
* For Ship Central, the output parameter for a list points to an array with multiple sets of data to generate one label for each carton or pallet.
-
-
Click Save.
Repeat this step to add more output parameters.
-
-
After setting up the Before Print action settings, input parameters, and output parameters, click Save.
-
After setting up all the mobile actions for printing, click Save.
-
To compile all your customizations, see Compiling Mobile Customizations.