pixiReadDeliveryItems
Returns delivery item rows from SDelDetail, filtered by creation and/or update date and paged by key in ascending order.
Reads delivery item rows (table SDelDetail) and returns at most @RowCount rows, always sorted by SDelDkey ascending.
Preparation:
- If
SDelDkeyis NULL it is set to0. - If
RowCountis NULL it is set to1000.
Only one filter mode is applied. The procedure checks the modes in this order and uses the first one that matches:
- Create or update date:
CreateAndUpdateDateFromand/orCreateAndUpdateDateTois set. A row matches the lower bound if its creation date or its update date is>=the From value. It matches the upper bound if its creation date or its update date is<the To value. - Create date:
CreateDateFromand/orCreateDateTois set. The filter usesSDelDcreateDate >= FromandSDelDcreateDate < To. - Update date:
UpdateDateFromand/orUpdateDateTois set. The filter usesSDelDupdateDate >= FromandSDelDupdateDate < To. - Key range: no date parameter is set. The call returns the next rows after
SDelDkey.
In every mode only rows with SDelDkey > @SDelDkey are returned. To page through the data, pass the highest SDelDkey of the previous response as SDelDkey in the next call. Stop when fewer than RowCount rows come back.
The upper bounds of the date ranges are exclusive. Parameters of a lower-priority mode are ignored when a higher-priority mode is active.
Notes
- All reads use
WITH (NOLOCK). Uncommitted data can be returned, and rows can be missed or appear twice while data is being changed. SDelDkeyis always used as an exclusive lower bound (>). Passing a specific key does not return that row; it returns the rows after it. The code has a branch for an exact key lookup and an empty-result branch, but neither can be reached, becauseSDelDkeyandRowCountare never NULL after the preparation step.- In the combined create/update mode, the From and To checks are evaluated independently. A row can match the From bound through one date and the To bound through the other date. For example, a row created before To and updated after To is still returned.
- A negative
RowCountcauses a SQL error inTOP.RowCount = 0returns no rows.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
SDelDkey
|
int | NULL |
Exclusive lower bound for the key of the delivery item. Only rows with a greater Example: |
CreateDateFrom
|
datetime dateTime |
NULL |
Inclusive lower bound for Example: |
CreateDateTo
|
datetime dateTime |
NULL |
Exclusive upper bound for Example: |
UpdateDateFrom
|
datetime dateTime |
NULL |
Inclusive lower bound for Example: |
UpdateDateTo
|
datetime dateTime |
NULL |
Exclusive upper bound for Example: |
CreateAndUpdateDateFrom
|
datetime dateTime |
NULL |
Inclusive lower bound that matches if either Example: |
CreateAndUpdateDateTo
|
datetime dateTime |
NULL |
Exclusive upper bound that matches if either Example: |
RowCount
|
int | 1000 |
Maximum number of rows returned. NULL is treated as Example: |
Result set 1 · Always; up to RowCount rows with SDelDkey > @SDelDkey, filtered by the active date mode, sorted by SDelDkey ascending.
Delivery items from SDelDetail.
| Column | Type | Description |
|---|---|---|
SDelDkey
|
int |
Key of the delivery item. |
SDelDHref
Nullable |
int |
Reference to the delivery header. |
SDelDItemRef
Nullable |
int |
Reference to the item (Artikel). |
SDelDItemName
Nullable |
string |
Item name on the delivery item. |
SDelDqtyDelivered
Nullable |
int |
Delivered quantity. |
SDelDqtyOrdered
Nullable |
int |
Ordered quantity. |
SDelDsorderlineRef
Nullable |
int |
Reference to the related order line. |
SDelDsPrice
Nullable |
decimal |
Price. |
SDelDsDiscount
Nullable |
decimal |
Discount. |
SDelDsFinalPrice
Nullable |
decimal |
Final price after discounts. |
SDelDcreateDate
Nullable |
datetime dateTime |
Creation date of the row. |
SDelDcreateEmp
Nullable |
string |
Employee who created the row. |
SDelDupdateDate
Nullable |
datetime dateTime |
Date of the last change. |
SDelDupdateEmp
Nullable |
string |
Employee who made the last change. |
SDelDsAddDiscount
Nullable |
decimal |
Additional discount. |
SDelDsMidPrice
Nullable |
decimal |
Intermediate price (as stored in |
BatchNumber
Nullable |
string |
Batch number (Charge) of the delivered goods. |
BestBeforeDate
Nullable |
dateTime |
Best-before date of the delivered goods. |
Response example
<SqlRowSet1>
<row>
<SDelDkey>10235</SDelDkey>
<SDelDHref>4120</SDelDHref>
<SDelDItemRef>88231</SDelDItemRef>
<SDelDItemName>USB-C Ladekabel 1m</SDelDItemName>
<SDelDqtyDelivered>50</SDelDqtyDelivered>
<SDelDqtyOrdered>50</SDelDqtyOrdered>
<SDelDsorderlineRef>77812</SDelDsorderlineRef>
<SDelDsPrice>2.50</SDelDsPrice>
<SDelDsDiscount>0.00</SDelDsDiscount>
<SDelDsFinalPrice>2.50</SDelDsFinalPrice>
<SDelDcreateDate>2024-01-15T09:12:44</SDelDcreateDate>
<SDelDcreateEmp>MK</SDelDcreateEmp>
<SDelDupdateDate>2024-01-15T10:03:10</SDelDupdateDate>
<SDelDupdateEmp>MK</SDelDupdateEmp>
<SDelDsAddDiscount>0.00</SDelDsAddDiscount>
<SDelDsMidPrice>2.50</SDelDsMidPrice>
<BatchNumber>CH-2024-001</BatchNumber>
<BestBeforeDate>2026-12-31T00:00:00</BestBeforeDate>
</row>
</SqlRowSet1>
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiReadDeliveryItems>
<!-- <SDelDkey>0</SDelDkey> -->
<!-- <CreateDateFrom>2024-01-01T00:00:00</CreateDateFrom> -->
<!-- <CreateDateTo>2024-02-01T00:00:00</CreateDateTo> -->
<!-- <UpdateDateFrom>2024-01-01T00:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-02-01T00:00:00</UpdateDateTo> -->
<!-- <CreateAndUpdateDateFrom>2024-01-15T00:00:00</CreateAndUpdateDateFrom> -->
<!-- <CreateAndUpdateDateTo>2024-01-16T00:00:00</CreateAndUpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
</ns1:pixiReadDeliveryItems>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiReadDeliveryItems>
<!-- <SDelDkey>0</SDelDkey> -->
<!-- <CreateDateFrom>2024-01-01T00:00:00</CreateDateFrom> -->
<!-- <CreateDateTo>2024-02-01T00:00:00</CreateDateTo> -->
<!-- <UpdateDateFrom>2024-01-01T00:00:00</UpdateDateFrom> -->
<!-- <UpdateDateTo>2024-02-01T00:00:00</UpdateDateTo> -->
<!-- <CreateAndUpdateDateFrom>2024-01-15T00:00:00</CreateAndUpdateDateFrom> -->
<!-- <CreateAndUpdateDateTo>2024-01-16T00:00:00</CreateAndUpdateDateTo> -->
<!-- <RowCount>500</RowCount> -->
</ns1:pixiReadDeliveryItems>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
// 'SDelDkey' => '0',
// 'CreateDateFrom' => '2024-01-01T00:00:00',
// 'CreateDateTo' => '2024-02-01T00:00:00',
// 'UpdateDateFrom' => '2024-01-01T00:00:00',
// 'UpdateDateTo' => '2024-02-01T00:00:00',
// 'CreateAndUpdateDateFrom' => '2024-01-15T00:00:00',
// 'CreateAndUpdateDateTo' => '2024-01-16T00:00:00',
// 'RowCount' => '500',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReadDeliveryItems', $soapArguments);
- SQL object:
- dbo.pipiReadDeliveryItems