pixiReadCodeTableValues
Returns code table values from pixi.CodeTableValue with their translated description, either a single value by Id or a page of values after a given Id.
Reads entries of the code table pixi.CodeTableValue together with their description text from dbo.Translation.
- If
Idis not passed, it is set to0. - Translations are loaded where
DBObjectName = 'CodeTableValue'andLanguageID = @LanguageId. The translation is matched on the value'sId. - The call then works in one of two modes:
- Paging mode (
RowCountis set): returns at mostRowCountvalues withId > @Id, sorted byIdascending. Pass the lastIdof a page asIdto read the next page. Start withId=0or leave it out. - Single mode (
RowCountis not set): returns the value withId = @Id.
- Paging mode (
The join to the translations is an inner join. Values without a translation in the requested language are not returned.
Notes
- All reads use
NOLOCK, so uncommitted data can appear. - If both
IdandRowCountare left out, the call looks for the value withId = 0and normally returns an empty result. To read all values, passRowCount. - The code contains a third branch that returns an empty result set. It can never run, because
Idis always set to0when it isNULL. - A negative
RowCountcauses a SQL error fromTOP. LanguageIddefaults to1. Which language this ID stands for depends on the content ofdbo.Translation.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
Id
|
int | NULL |
Without Example: |
RowCount
|
int | NULL |
Maximum number of rows per page. If set, the call switches to paging mode ( Example: |
LanguageId
|
int | 1 |
Language of the description text ( Example: |
Result set 1 · Always. Contains one value (single mode) or up to RowCount values (paging mode); it can be empty.
Code table values with their translated description.
| Column | Type | Description |
|---|---|---|
Id
|
int |
Unique ID of the code table value; use it as |
CodeTableTypeId
Nullable |
int |
ID of the code table type the value belongs to. |
Code
Nullable |
string |
Code of the value. |
CodeDescription
Nullable |
string |
Description text from |
IsEnabled
Nullable |
boolean |
Indicates whether the value is enabled. |
IsSystem
Nullable |
boolean |
Indicates whether the value is a system value. |
SortOrder
Nullable |
int |
Sort order of the value within its code table type. |
IsDefault
Nullable |
boolean |
Indicates whether the value is the default value of its code table type. |
Response example
<SqlRowSet1>
<row>
<Id>1</Id>
<CodeTableTypeId>1</CodeTableTypeId>
<Code>STD</Code>
<CodeDescription>Standard</CodeDescription>
<IsEnabled>true</IsEnabled>
<IsSystem>true</IsSystem>
<SortOrder>1</SortOrder>
<IsDefault>true</IsDefault>
</row>
<row>
<Id>2</Id>
<CodeTableTypeId>1</CodeTableTypeId>
<Code>EXP</Code>
<CodeDescription>Express</CodeDescription>
<IsEnabled>true</IsEnabled>
<IsSystem>false</IsSystem>
<SortOrder>2</SortOrder>
<IsDefault>false</IsDefault>
</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:pixiReadCodeTableValues>
<!-- <Id>0</Id> -->
<!-- <RowCount>100</RowCount> -->
<!-- <LanguageId>1</LanguageId> -->
</ns1:pixiReadCodeTableValues>
</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:pixiReadCodeTableValues>
<!-- <Id>0</Id> -->
<!-- <RowCount>100</RowCount> -->
<!-- <LanguageId>1</LanguageId> -->
</ns1:pixiReadCodeTableValues>
</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 = [
// 'Id' => '0',
// 'RowCount' => '100',
// 'LanguageId' => '1',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReadCodeTableValues', $soapArguments);
- SQL object:
- dbo.pipiReadCodeTableValues