pixiSetFulfillmentOptions
Sets the direct fulfillment type (DF_type) of one orderline or of all orderlines of an order and resets editable lines to status ANG.
Assigns a direct fulfillment type to orderlines and returns the result per orderline.
- If
DF_Typeis0, it is treated asNULL, i.e. the fulfillment type is removed. - The orderlines to process are collected:
OrderlineKey> 0: this single orderline is added (without checking its status or whether it exists).OrderNr> 0: all orderlines of this order whoseStatusis notHAL(on hold) are added.- Both parameters can be combined; if neither is > 0, nothing is processed and an empty result set is returned.
- Each collected orderline is checked for editability. An orderline is not editable (
IsEditable= 0) if- the order history (
OrderHistory) contains an entry for it with a status other thanHAL,ANG,BES,FUT,NEW, or aFUTentry withClientNotified=Y, or - it is on a picklist (
PLitem/PLHeader) whose expiry datePLHexpiryDateis in the future. Otherwise it is editable (IsEditable= 1).
- the order history (
- For all editable orderlines
DF_typeis set to the given value andStatusis set toANG. - One row per collected orderline is returned with the current order number, key, status, DF type and the editability flag.
Notes
- The update runs in its own transaction, or as a savepoint if the caller already has an open transaction.
- The status of every editable orderline is set to
ANG, regardless of its previous status. An orderline passed directly viaOrderlineKeyis not filtered forHAL, so an orderline on hold can be released toANGthis way. - If the same orderline is passed via
OrderlineKeyand belongs toOrderNr, it appears twice in the result. - If
OrderlineKeydoes not exist, a row withNULLin all orderline columns andIsEditable= 1 is returned. - Lookups on
Orderlines,OrderHistory,PLitemandPLHeaderuseNOLOCK; the result set is also read withNOLOCK. - On an error the transaction is rolled back, the error is logged via
log.InsertError(definition not attached) and an error row is returned instead of the result rows.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderlineKey
|
int | NULL |
Key of a single orderline to update. Ignored if NULL or <= 0. Example: |
OrderNr
|
int | NULL |
Order number; all orderlines of this order that are not on hold ( Example: |
DF_Type
|
int | NULL |
Direct fulfillment type to set on the orderlines. Example: |
Result set 1 · On success; one row per collected orderline (empty if neither parameter is > 0)
State of the processed orderlines after the update.
| Column | Type | Description |
|---|---|---|
OrderNr
Nullable |
int |
Order number of the orderline; NULL if the orderline does not exist. |
OrderlineKey
Nullable |
int |
Key of the orderline; NULL if the orderline does not exist. |
Status
Nullable |
string |
Current status of the orderline ( |
DF_type
Nullable |
int |
Current direct fulfillment type of the orderline. |
IsEditable
Nullable |
bit boolean |
1 if the orderline was editable and has been updated, 0 if it was locked by order history or an active picklist. |
Result set 2 · If an error occurs during the update
Error row after rollback.
| Column | Type | Description |
|---|---|---|
ErrorNr
|
int |
Error number, always 500. |
ErrorMessage
|
varchar(71) string |
Error text. |
Response example
<SqlRowSet1>
<row>
<OrderNr>98765</OrderNr>
<OrderlineKey>123456</OrderlineKey>
<Status>ANG</Status>
<DF_type>1</DF_type>
<IsEditable>true</IsEditable>
</row>
<row>
<OrderNr>98765</OrderNr>
<OrderlineKey>123457</OrderlineKey>
<Status>AUS</Status>
<IsEditable>false</IsEditable>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| 500 | Orderline Update failed on DB level. Please ask pixi* Support for help. | Any database error during the update or the result query; the transaction is rolled back and the error is logged. Contact pixi* support. |
| RAISERROR | Orderline Update failed on DB level. Please ask pixi* Support for help. | Informational message (severity 0) if no transaction is open after the update; processing continues. Not expected under normal conditions. |
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:pixiSetFulfillmentOptions>
<!-- <OrderlineKey>123456</OrderlineKey> -->
<!-- <OrderNr>98765</OrderNr> -->
<!-- <DF_Type>1</DF_Type> -->
</ns1:pixiSetFulfillmentOptions>
</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:pixiSetFulfillmentOptions>
<!-- <OrderlineKey>123456</OrderlineKey> -->
<!-- <OrderNr>98765</OrderNr> -->
<!-- <DF_Type>1</DF_Type> -->
</ns1:pixiSetFulfillmentOptions>
</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',
// 'OrderNr' => '98765',
// 'DF_Type' => '1',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSetFulfillmentOptions', $soapArguments);
- SQL object:
- dbo.pipiSetFulfillmentOptions