The fetch_objects tool reads Pricefx objects of one type, for example Products, Customers, Contracts, Quotes, or Action Items. You can filter, sort, and page through the results. The tool returns all fields of each object.
Tool Name – fetch_objects
Title – Fetch objects
Type – Private
Access Profile – Operator
Permissions
The fetch_objects tool runs with your Pricefx session. It does not apply the same data restrictions as the Pricefx user interface, so it can return objects that you cannot open in Pricefx.
When to Use
Use a more specific tool when one exists for the object type, for example the Quote Search tool for Quotes. Use fetch_objects for cases that other tools do not cover yet, for example:
-
Read Advanced Configuration Options, for example the SIP configuration.
-
Find the Data Sources that a Datamart uses, or the Data Source of a Datamart field.
Parameters
|
Parameter |
Required |
Description |
|---|---|---|
|
|
Yes |
Type code of the objects to read, for example P for products. See Type Codes. |
|
|
No |
Field to filter on, for example uniqueName or sku. |
|
|
No |
One or more values to compare with |
|
|
No |
How the tool compares |
|
|
No |
Position of the first object to return, starting at 0.
|
|
|
No |
Maximum number of objects to return, from 1 to 200.
|
|
|
No |
Field to sort by. Add |
Type Codes
The tool accepts most Pricefx type codes. Some types cannot be read this way. See Behavior and Limitations. These are the most common ones:
|
Type Code |
Objects |
|---|---|
|
AI |
Action Items |
|
AP |
Advanced Configuration Options |
|
C |
Customers |
|
CT |
Contracts |
|
DM |
Datamarts |
|
DMDS |
Data Sources |
|
MO |
Model Objects |
|
P |
Products |
|
PG |
Live Price Grids |
|
PL |
Price Lists |
|
Q |
Quotes |
|
R |
User Roles |
|
RBA |
Rebate Agreements |
|
U |
Users |
|
W |
Workflows |
Filter Operators
|
Group |
Operators |
|---|---|
|
Equality |
|
|
Comparison |
|
|
Empty value |
|
|
Text |
|
|
Range |
|
|
List |
|
Output
The tool returns a list of objects. Each object includes all of its fields, as Pricefx stores them. The tool does not return the total number of matching objects. If the tool returns as many objects as max_rows, more objects may exist. To get them, increase start_row.
Behavior and Limitations
-
Some type codes cannot be read with this tool, for example MLTV2 for rows of lookup tables with two keys. For these types, the tool returns a "Not authorized for command" error, even when you have access to the data in Pricefx. LT (lookup table definitions) and MLTV (rows of lookup tables with one key) work.
-
The tool filters on one field only. To filter on several fields, use a more specific tool, for example the Quote Search tool for Quotes.
-
The filter is applied only when both
filter_propertyandfilter_valuesare given. If one of them is missing, orfilter_valuesis an empty list, the tool returns objects without a filter and does not report an error. Afilter_operatorgiven without them is also ignored. -
Without
filter_operator, the tool uses contains, which also matches part of a value. For example, Q-1 also matches Q-10 and Q-123. For predictable results, always setfilter_operator, for example equals or inSet for an exact match. -
To look up many objects by exact value, use inSet. The tool sends all values as one condition. With other operators, the tool sends one condition for each value.
-
The tool returns all fields of each object, so the output can be very large and uses a lot of the AI model's context. Keep
max_rowslow. To see which fields an object type has, setmax_rowsto 1. -
To read Datamart or Data Source data, use the Datamart Query Data tool. The
fetch_objectstool returns Datamart and Data Source definitions, not their rows.
See Also