pixiSupplierOrderLineLocQtyDelete
Deletes a location quantity record of a supplier order line and returns a status row with ReturnCode and ErrorMessage.
Removes one location quantity entry (SupplierOrderLineLocQty) of a supplier order (purchase order) line. The supplier order is updated accordingly by the internal procedure.
Steps:
- Opens its own transaction, or sets a savepoint if a transaction is already open.
- Resolves the user: if
UserIdis empty, the user ID is looked up byUserName. If that name does not exist, the userpixiAdministrationis used. - Treats
NULLforConsiderPackageUnitsandConsiderMinOrderQtyas0. - Calls the internal procedure
pixi.SupplierOrderLineLocQtyDeletewith the user, the record ID and both flags. This procedure does the actual deletion. - Checks whether the record with
SupplierOrderLineLocQtyIdstill exists. If so, the result isWARNINGwith a message. - Commits and returns one row with
ReturnCode(SUCCESSorWARNING) andErrorMessage.
If an error occurs, the transaction (or the savepoint) is rolled back. A row with ReturnCode = ERROR and the SQL error text is returned.
Notes
- The deletion logic, including how package units and minimum order quantities are considered and how the supplier order is updated, is in
pixi.SupplierOrderLineLocQtyDelete. That procedure is not attached, so its exact behaviour and the tables it changes are not documented here. AppNameis required but not used by the code.- The existence check after the deletion reads
pixi.SupplierOrderLineLocQtywithNOLOCK. - On success or warning, the status row is only returned if the call opened its own transaction. If the call runs inside an outer transaction, no row is returned on success. Error rows are always returned.
- A
WARNINGdoes not roll back anything. Whatever the internal procedure changed is committed.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
AppName
Required
|
varchar(255) string |
– |
Name of the calling application. Required, but not used by the code. Example: |
UserId
|
int | NULL |
ID of the executing user. If empty, the user is determined from Example: |
UserName
Required
|
varchar(50) string |
– |
User name, used only if Example: |
SupplierOrderLineLocQtyId
Required
|
int | – |
ID of the supplier order line location quantity record ( Example: |
ConsiderPackageUnits
|
bit boolean |
0 |
Whether package units are considered when the supplier order is updated. Allowed values
Example: |
ConsiderMinOrderQty
|
bit boolean |
0 |
Whether minimum order quantities are considered when the supplier order is updated. Allowed values
Example: |
Result set 1 · Always when no outer transaction exists; on error always.
Status row of the deletion.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(20) string |
|
ErrorMessage
Nullable |
varchar(100) string |
|
Response example
<SqlRowSet1>
<row>
<ReturnCode>SUCCESS</ReturnCode>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| WARNING | Purchase order line location quantity was not deleted. | The record with `SupplierOrderLineLocQtyId` still exists after the internal delete procedure ran. For example, the internal procedure did not delete it. Check the ID and the state of the supplier order line. |
| ERROR | {ERROR_MESSAGE()} | Any SQL error raised during processing, e.g. by `pixi.SupplierOrderLineLocQtyDelete`. The transaction or savepoint is rolled back. |
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:pixiSupplierOrderLineLocQtyDelete>
<AppName>MyShopConnector</AppName>
<!-- <UserId>12</UserId> -->
<UserName>jdoe</UserName>
<SupplierOrderLineLocQtyId>45871</SupplierOrderLineLocQtyId>
<!-- <ConsiderPackageUnits>0</ConsiderPackageUnits> -->
<!-- <ConsiderMinOrderQty>0</ConsiderMinOrderQty> -->
</ns1:pixiSupplierOrderLineLocQtyDelete>
</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:pixiSupplierOrderLineLocQtyDelete>
<AppName>MyShopConnector</AppName>
<!-- <UserId>12</UserId> -->
<UserName>jdoe</UserName>
<SupplierOrderLineLocQtyId>45871</SupplierOrderLineLocQtyId>
<!-- <ConsiderPackageUnits>0</ConsiderPackageUnits> -->
<!-- <ConsiderMinOrderQty>0</ConsiderMinOrderQty> -->
</ns1:pixiSupplierOrderLineLocQtyDelete>
</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 = [
'AppName' => 'MyShopConnector',
// 'UserId' => '12',
'UserName' => 'jdoe',
'SupplierOrderLineLocQtyId' => '45871',
// 'ConsiderPackageUnits' => '0',
// 'ConsiderMinOrderQty' => '0',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSupplierOrderLineLocQtyDelete', $soapArguments);
- SQL object:
- dbo.pipiSupplierOrderLineLocQtyDelete