pixiSupplierOrderLineLocQtyCreate
Creates a location-specific quantity for one supplier order line, optionally rounded to package units and the minimum order quantity.
Adds a quantity for a specific location (Lagerort) to an existing supplier order line. The actual insert is done by the internal procedure pixi.SupplierOrderLineLocQtyCreate.
Steps:
- Opens a transaction, or sets a savepoint if the caller already has an open transaction.
- Resolves the user: if
UserIdis empty, the user is looked up byUserName. If that name does not exist, the userpixiAdministrationis used. - Resolves the location in
dbo.Location. IfLocationIdis passed, it is matched againstLocationKey. OtherwiseLocationis matched against the location codeLocID.LocationIdtakes priority overLocation. - Checks whether a quantity for this order line and location already exists in
pixi.SupplierOrderLineLocQty. If so, the messageLocation already exists for sent location.is prepared. - If the location was found:
NULLvalues ofConsiderPackageUnitsandConsiderMinOrderQtyare treated as0.- The internal create procedure is called with the order line, location, quantity and both flags. It is asked to return the inserted IDs.
- If the location was not found, the message
Match value for parameter Location does not exists in db.is prepared and nothing is created. - If a message was prepared, a row with
ReturnCode=ERRORandErrorMessageis returned. - Commits its own transaction.
If a SQL error occurs, the transaction is rolled back where possible and an ERROR row with the SQL error text is returned.
Notes
- Duplicate check does not block the insert. If a quantity for the location already exists, the error message is prepared, but the internal create procedure is still called. The caller therefore receives the result of the internal procedure followed by an
ERRORrow. Whether a duplicate is created or rejected depends onpixi.SupplierOrderLineLocQtyCreate, whose definition is not attached. - The behaviour of the internal procedure is not visible here. This covers which IDs it returns, how package units and minimum order quantity are applied, and which further tables it writes.
AppNameis required but not used in the code.UserNameis required even whenUserIdis passed.dbo.Locationandpixi.SupplierOrderLineLocQtyare read withNOLOCK.- If the caller has an outer transaction and a non-fatal error occurs, the code does not roll back. Changes made up to the error may remain in the outer transaction.
- Success produces no explicit status row. Only the result of the internal procedure is returned.
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 acting user. If empty, the user is determined from Example: |
UserName
Required
|
varchar(50) string |
– |
User name, used when Example: |
SupplierOrderLineId
Required
|
int | – |
ID of the supplier order line that receives the location quantity. Example: |
Location
|
varchar(3) string |
NULL |
Location code ( Example: |
LocationId
|
int | NULL |
Location key ( Example: |
Qty
Required
|
int | – |
Quantity for the location. Example: |
ConsiderPackageUnits
|
bit boolean |
0 |
Whether package units are considered by the internal create procedure. Allowed values
Example: |
ConsiderMinOrderQty
|
bit boolean |
0 |
Whether the minimum order quantity is considered by the internal create procedure. Allowed values
Example: |
Result set 1 · When the location was found and the internal procedure pixi.SupplierOrderLineLocQtyCreate returns rows
Result of the internal create procedure, called with ReturnInsertedIds = 1, presumably the inserted IDs. Its columns cannot be determined because the definition is not attached.
Result set 2 · If the location was not found, already exists for the line, or a SQL error occurred
Error status row.
| Column | Type | Description |
|---|---|---|
ReturnCode
|
varchar(5) string |
Always |
ErrorMessage
Nullable |
nvarchar(4000) string |
Error text. |
Response example
<SqlRowSet1>
<row>
<ReturnCode>ERROR</ReturnCode>
<ErrorMessage>Match value for parameter Location does not exists in db. </ErrorMessage>
</row>
</SqlRowSet1>
| Status | Message | Cause |
|---|---|---|
| ERROR | Location already exists for sent location. | A quantity for this supplier order line and location already exists. The internal create procedure is still called, so check for existing entries before calling. |
| ERROR | Match value for parameter Location does not exists in db. | Neither `LocationId` nor `Location` matches a location in `dbo.Location`. Pass a valid location key or code. |
| ERROR | {ERROR_MESSAGE()} | A SQL error occurred, e.g. in the internal create procedure. The message contains the SQL Server error text. |
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:pixiSupplierOrderLineLocQtyCreate>
<AppName>MyWarehouseTool</AppName>
<!-- <UserId>12</UserId> -->
<UserName>jdoe</UserName>
<SupplierOrderLineId>45871</SupplierOrderLineId>
<!-- <Location>001</Location> -->
<!-- <LocationId>1</LocationId> -->
<Qty>24</Qty>
<!-- <ConsiderPackageUnits>1</ConsiderPackageUnits> -->
<!-- <ConsiderMinOrderQty>0</ConsiderMinOrderQty> -->
</ns1:pixiSupplierOrderLineLocQtyCreate>
</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:pixiSupplierOrderLineLocQtyCreate>
<AppName>MyWarehouseTool</AppName>
<!-- <UserId>12</UserId> -->
<UserName>jdoe</UserName>
<SupplierOrderLineId>45871</SupplierOrderLineId>
<!-- <Location>001</Location> -->
<!-- <LocationId>1</LocationId> -->
<Qty>24</Qty>
<!-- <ConsiderPackageUnits>1</ConsiderPackageUnits> -->
<!-- <ConsiderMinOrderQty>0</ConsiderMinOrderQty> -->
</ns1:pixiSupplierOrderLineLocQtyCreate>
</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' => 'MyWarehouseTool',
// 'UserId' => '12',
'UserName' => 'jdoe',
'SupplierOrderLineId' => '45871',
// 'Location' => '001',
// 'LocationId' => '1',
'Qty' => '24',
// 'ConsiderPackageUnits' => '1',
// 'ConsiderMinOrderQty' => '0',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiSupplierOrderLineLocQtyCreate', $soapArguments);
- SQL object:
- dbo.pipiSupplierOrderLineLocQtyCreate