Dispatch: From An SQL Source

Dispatch Process

Sync & Save PLUS Dispatch follows these steps each time a sql type (Sql Server, MySql, Oracle, Access, Sybase ASE, ODBC) dispatch job runs:

  1. Sync & Save queries the source database for records to dispatch using the query entered in the Query SQL box.


    • The Query SQL should only return records that have not already been dispatched.
    • Click the preview button to see the resulting records.

  2. Sync & Save transforms the data received using the format configured on the format tab.


    • Click the refresh button on the left side of the screen to populate the first 25 records produced by the Query SQL.
    • Click Populate Fields to refresh the list of fields that can be populated.
    • Map the data you wish to upload by dragging fields from the left side of the screen.
    • The @mobileNumber field is not required. However, if it is included the record status will be set to "Sent" and the record will be delivered to the correct mobile unit, otherwise the status will be set to "Pending".
    • Note that Date Time type fields should be populated with UTC/GMT values.

  3. Sync & Save uploads each dispatch record to the doForms web service which pre-populates the form fields and sends it to the correct mobile device (if specified).

  4. Sync & Save executes the Post Dispatch SQL statement for each dispatch record after receiving a response back from the doForms web service.


    • This step should be used to mark the records as having been successfully dispatched so that they are no longer included in the results of the Query SQL.
    • All the data fields returned by the Query SQL statement are available as parameters for this sql statement. Add an @ symbol before the field name to include the field as a parameter (e.g. @DispatchID above). Note: Use : instead of @ for Oracle.
    • The special parameter fields @DispatchKey and @DispatchStatus (see below) are also available.
    • Records that fail to be dispatched successfully will have the @DispatchStatus = -1 and @DispatchKey = "".
    • Click the preview button to view a sample sql statement prepared with the parameter values replaced.

  5. Sync & Save queries the doForms web service for the status of all current dispatch records and executes the Status Sync SQL statement for each record received.


    • This step is generally used to keep the source database up to date as records advance through the dispatch workflow.
    • The only parameter fields available to this step are @DispatchStatus, @DispatchKey, @DispatchStatusName and @DispatchStatusDate.
    • Leave this field blank if you don't wish to download updated status values from doForms.
    • Click the preview button to view a sample sql statement prepared with the parameter values replaced.

@DispatchKey

The @DispatchKey parameter is populated with the value of the key field for the dispatch record from the doForms web service. The value is an approximately 90 character long text string.

@DispatchStatus

The @DispatchStatus parameter is populated with the following numeric values from the doForms web service:


1.  Pending -- Received by the doForms web service, but no action has been taken.
2.  Scheduled -- Scheduled to be sent to a mobile device.
3.  Sent -- Sent to a mobile device.
4.  Received -- Received by a mobile device.
5.  Viewed -- Viewed by the user on the mobile device.
6.  Rejected -- Rejected by the user.
7.  Completed -- Completed by the user.
10. Recurring -- A recurring dispatch.
11. Unlocked -- Automatically unlocked after timeout has passed.

@DispatchStatusName


The @DispatchStatusName parameter is populated with the name of the corresponding dispatch status.

@DispatchStatusDate


The @DispatchStatusDate parameter is populated with the DateTime value (in UTC) of when the current dispatch status was set.

@DispatchActionStatus


The @DispatchActionStatus parameter is populated with any Status text values sent by an Action control on the form. This parameter is available beginning with version 1.12.11.


Feedback and Knowledge Base