Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Submit – PB Docs 2019 – PowerBuilder Library

Submit – PB Docs 2019

Submit

Description

Sends the data to the server via the HTTP POST method and then gets
the response body from the server.

It is not recommended to use this method to process large data (20
MB or 100,000 data rows can be considered as large data based on our
tests).

Applies to

RESTClient object

Syntax

Argument

Description

objectname

The name of the RESTClient object.

urlName

The URL indicating where the data will be
submitted.

response

The content of the server response.

If RESTClient failed to send request or server provides no
response, the response value is an empty string. If the response
value is compressed as gzip, it will be automatically
decompressed. Only gzip compression format is supported at this
moment. If the server specified the Content-Type response
header, and in which the encoding charset is specified, this
function will encode the data with the specified charset, if
charset is not specified, this function will encode the data in
UTF-8 by default.

dwObject

The DataWindow control, DataStore, or DataWindowChild
object whose data will be submitted.

primarydata

A boolean indicating whether to export and submit the data
from the primary buffer.

  • True — to export.

  • False — not to export.

filterdata

A boolean indicating whether to export and submit the data
from the filter buffer.

  • True — to export.

  • False — not to export.

deletedata

A boolean indicating whether to export and submit the data
from the delete buffer.

  • True — to export.

  • False — not to export.

dwcdata

A boolean specifying whether to export the DataWindowChild
data.

  • True — to export. If it is to export the
    DataWindowChild data, data from all buffers will be exported
    to a plain JSON, regardless of the value of the other
    arguments.

  • False — not to export.

dwbuffer

A value of the dwBuffer enumerated datatype identifying
the DataWindow buffer from which you want to export the data.
For a list of valid values, see the section called “DWBuffer” in DataWindow Reference.

If not specified, all of the DataWindow buffers will be
exported, however, the data for DataWindowChild will not be
exported (even if changedonly is false).

startrow (optional)

A long value specifying the start row in the dwbuffer
DataWindow buffer. The default is 1. If it is 0 or negative, 1 is
used.

endrow (optional)

A long value specifying the end row in the dwbuffer
DataWindow buffer. The default is the rest of the rows. If it is 0
or negative, it indicates the rest of rows.

startcol (optional)

A long value specifying the start column in the dwbuffer
DataWindow buffer. The default is 1. If it is 0 or negative, 1 is
used.

endcol (optional)

A long value specifying the end column in the dwbuffer
DataWindow buffer. The default is the rest of the columns. If it
is 0 or negative, it indicates the rest of columns.

changedonly

A boolean specifying the changing flag.

  • True — to export the changed rows only (and all rows
    of the Delete buffer).

  • False — to export all rows. The default is
    false.

format (optional)

A boolean specifying the JSON format.

  • True indicates the DataWindow JSON. For syntax 1, 3,
    4, the default is true.

  • False indicates the plain JSON. For syntax 2, the
    default is false.

See the section called “Supported JSON formats” in Application Techniques for details about the JSON
format.

package

A reference to JsonPackage object whose data will be
submitted.

Return value

Integer. Returns 1 if the function succeeds and a negative value if
an error occurs. If any argument’s value is null, the method returns
null.

1 — Success

-1 — General error

-2 — Invalid URL

-3 — Cannot connect to the Internet

-4 — Timeout

-6 — Failed to export JSON

-7 — Failed to decompress data

-10 — The token is invalid or has expired

-14 — Code conversion failed

-15 — Unsupported character set

Examples

The following example demonstrates the usage of syntax 1:
Submit(string urlName, ref string response, DWControl dwObject{, boolean
format}).

The following example submits the data of the DataWindow primary
buffer using syntax 2: Submit(string urlName, ref string response,
DWControl dwObject {,DWBuffer dwbuffer}, boolean changedonly, boolean
format).

The following example submits the data of the DataWindow delete
buffer using syntax 3: Submit(string urlName, ref string response,
DWControl dwObject, boolean primarydata, boolean filterdata, boolean
deletedata, boolean dwcdata {, boolean format}).

The following example submits the data of the specified row and
column using syntax 4: Submit(string urlName, ref string response,
DWControl dwObject, DWBuffer dwbuffer{,long startrow{, long endrow{, long
startcol{, long endcol}}}} {, boolean format}).

The following example submits data via JSONPackage object and token
authentication using syntax 5: Submit(string urlName, ref string response,
ref JsonPackage package).


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x