Fetch Objects

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

type_code

Yes

Type code of the objects to read, for example P for products. See Type Codes.

filter_property

No

Field to filter on, for example uniqueName or sku.

filter_values

No

One or more values to compare with filter_property. With several values, an object matches when any of the values matches.

filter_operator

No

How the tool compares filter_property with filter_values. See Filter Operators. The default is contains.

start_row

No

Position of the first object to return, starting at 0.
Default: 0.

max_rows

No

Maximum number of objects to return, from 1 to 200.
Default: 5.
Values outside this range are changed to the nearest allowed value.

sort

No

Field to sort by. Add - before the field name for descending order, for example -lastUpdateDate.
Default: no specific order.

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

  • equals

  • iEquals

  • notEqual

  • iNotEqual

Comparison

  • greaterThan

  • greaterOrEqual

  • lessThan

  • lessOrEqual

Empty value

  • isNull

  • notNull

Text

  • contains

  • iContains

  • notContains

  • iNotContains

  • startsWith

  • iStartsWith

  • notStartsWith

  • iNotStartsWith

  • endsWith

  • iEndsWith

  • notEndsWith

  • iNotEndsWith

  • containsPattern

  • iContainsPattern

Range

  • between

  • betweenInclusive

  • iBetween

  • iBetweenInclusive

List

  • inSet

  • notInSet

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_property and filter_values are given. If one of them is missing, or filter_values is an empty list, the tool returns objects without a filter and does not report an error. A filter_operator given 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 set filter_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_rows low. To see which fields an object type has, set max_rows to 1.

  • To read Datamart or Data Source data, use the Datamart Query Data tool. The fetch_objects tool returns Datamart and Data Source definitions, not their rows.

See Also