pixiCanCancelOrderline
Checks whether an order line can still be cancelled and returns 1 (yes) or 0 (no).
Scalar function that evaluates a single order line identified by OrderlineKey.
The order line is joined with OrderStates on its Status. The function returns 1 only if all of the following conditions are met:
- the status of the order line is not a final state (
OrderStates.FinalStateisNor NULL), - the status of the order line is not
EIN, - the order line is not referenced in
BoxItems(not packed into a box), - the order line is not referenced in
InvLines(not invoiced).
If any of these conditions fails, the function returns 0.
The function only checks; it does not change any data.
Notes
- The result is
NULLif no order line with the given key exists or if itsStatushas no matching entry inOrderStates(inner join). - All tables are read with
NOLOCK, so the result can reflect uncommitted data. - The checks against
BoxItemsandInvLinesuseNOT IN. IfBoxItems.OrderLineReforInvLines.OrderlineRefcontains NULL values, the condition never evaluates to true and the function returns0for every order line. - The function does not cancel anything; it only indicates whether a cancellation is allowed.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderlineKey
Required
|
int | – |
Key of the order line to check ( Example: |
Result set 1 · Always
Single value returned by the scalar function.
| Column | Type | Description |
|---|---|---|
Result
Nullable |
int |
|
Response example
<SqlRowSet1>
<row>
<Result>1</Result>
</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:pixiCanCancelOrderline>
<OrderlineKey>123456</OrderlineKey>
</ns1:pixiCanCancelOrderline>
</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:pixiCanCancelOrderline>
<OrderlineKey>123456</OrderlineKey>
</ns1:pixiCanCancelOrderline>
</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',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiCanCancelOrderline', $soapArguments);
- SQL object:
- dbo.pipiCanCancelOrderline