pixiSetOrderlineLocation
Moves a single order line or a bundle order line, together with the related bundle lines, to another location (LocID).
Changes the location (LocationID and LastOrdLocationID) of order lines. The call delegates to the internal procedure Pixi_UpdateOrderLocation with user name API and returns one status row.
Which records are changed
- Only
OrderlineKeygiven: the order line itself is moved. If the line belongs to a bundle, all other lines of the same bundle and the bundle order line (BundleOrderlines) are moved as well. - Only
BundleOrderlineKeygiven: all component order lines of this bundle and the bundle order line itself are moved. The component lines are moved only if the bundle order line has an eligible status. - Neither key given: the call fails, because no order can be determined.
Only lines with an eligible status are updated. Eligible statuses are all non-final states from OrderStates (FinalState = 'N') except EIN, FUT and FUS. Lines with any other status are skipped silently, and the call still returns OK.
Validation
The internal procedure checks the following and rejects the call if a check fails:
- The order line or bundle order line exists.
LocationIdexists inLocation.- At least one line of the order has the status
NEW,ANG,HAL,MIN,BES,STOorNLB. - None of the affected order lines is on a picklist (
PLitem).
POS / reservation locations
If the target location has a ResLocID, ResOnLocDate of the order header is reset to NULL. The procedure then looks at other orders that have eligible lines on the same location with the same items. If the latest ResOnLocDate of those orders is earlier than the earliest reservation date of this order, all reservations of this order get that latest ResOnLocDate plus one second as their new ResDate.
Result
The call returns ReturnCode = 'OK' on success. Otherwise it returns ReturnCode = 'ERROR' with the generic message Ilegal parameters.
Notes
-
All failure reasons of the internal procedure collapse into the single message
Ilegal parameters. The detailed reasons are only emitted viaPRINT, for exampleERROR: Wrong LocationID: ...or... must not be on Picklist. Whether a SOAP client receives these texts is not visible in the code. -
UpdateEmpis set toAPIandUpdateDateto the current time on all updated rows. -
The internal procedure runs in its own transaction, or uses a savepoint if a transaction is already open. On a runtime error it rolls back, logs the error via
log.InsertErrorand the call returnsERROR. -
During the update of
BundleOrderlines,CONTEXT_INFOis temporarily set to0x30000. According to a code comment this avoids recalculating bundles; the triggers that evaluate it are not attached. -
Validation reads use
NOLOCK; updates useROWLOCK. -
Passing both
OrderlineKeyandBundleOrderlineKeyis not recommended:- The bundle key determines the order.
- The bundle order line itself is not updated.
- The same order lines can be collected twice, so creating the unique index on the internal temp table fails and the call returns
ERROR.
Pass only one of the two keys.
-
The status check (
NEW,ANG,HAL, ...) only requires one line of the whole order in such a status, not necessarily the target line.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderlineKey
|
int | NULL |
Key of the order line to move. If the line belongs to a bundle, the other bundle lines and the bundle order line are moved too. Either this or Example: |
BundleOrderlineKey
|
int | NULL |
Key of the bundle order line ( Example: |
LocationId
Required
|
char(3) string |
– |
Target location ( Example: |
Result set 1 · Always
Status row of the call.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(5) string |
|
ErrorMessage
|
varchar(17) string |
Empty on success, otherwise |
Response example
<SqlRowSet1>
<row>
<ReturnCode>OK</ReturnCode>
<ErrorMessage/>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| ERROR | Ilegal parameters | Neither `OrderlineKey` nor `BundleOrderlineKey` was passed, or the given order line / bundle order line does not exist. |
| ERROR | Ilegal parameters | `LocationId` does not exist in table `Location`. Pass a valid `LocID`. |
| ERROR | Ilegal parameters | No line of the order has the status `NEW`, `ANG`, `HAL`, `MIN`, `BES`, `STO` or `NLB`. |
| ERROR | Ilegal parameters | One of the affected order lines is already on a picklist (`PLitem`). |
| ERROR | Ilegal parameters | A runtime error occurred during the update, for example duplicate lines when both keys are passed. The transaction is rolled back and the error is logged. |
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:pixiSetOrderlineLocation>
<!-- <OrderlineKey>123456</OrderlineKey> -->
<!-- <BundleOrderlineKey>4711</BundleOrderlineKey> -->
<LocationId>001</LocationId>
</ns1:pixiSetOrderlineLocation>
</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:pixiSetOrderlineLocation>
<!-- <OrderlineKey>123456</OrderlineKey> -->
<!-- <BundleOrderlineKey>4711</BundleOrderlineKey> -->
<LocationId>001</LocationId>
</ns1:pixiSetOrderlineLocation>
</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 = [
// 'OrderlineKey' => '123456',
// 'BundleOrderlineKey' => '4711',
'LocationId' => '001',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetOrderlineLocation', $soapArguments);
- SQL object:
- dbo.pipiSetOrderlineLocation