JS Client API
  • Getting Started
  • Rule Engine Unique Functions
  • Custom Form Window Functions
  • Use Cases & Code Samples
  • Known Issues
  • Retrieving Data
    • Retrieving Standard Resources
    • Retrieving User Defined Tables
    • Retrieving Attachments
    • Retrieving Items in Transaction Scope
    • Retrieving Transaction Lines
    • ADAL
  • Updating Data
    • Adding Objects to Standard Resources
    • Updating Standard resources
    • Updating User Defined Table
    • Updating Items in Transaction Scope
    • Adding Transaction Lines
    • Removing Transaction Lines
Powered by GitBook
On this page
  1. Retrieving Data

Retrieving User Defined Tables

PreviousRetrieving Standard ResourcesNextRetrieving Attachments

Last updated 17 days ago

Was this helpful?

CtrlK

Was this helpful?

Data Retrieval Methods

Get Single Value from User Defined Table

  • Description: Retrieves a single value from a UDT using the get function,

  • Syntax:

    pepperi.api.userDefinedTables.get({
      table: "<tableName>",
      mainKey: "<mainKey>",
      secondaryKey: "<secondaryKey>"
    });
  • Example:

    pepperi.api.userDefinedTables.get({
      table: "myTable",
      mainKey: "Item123",
      secondaryKey: "Category124"
    });
  • Returns:

    {
      "success": true,
      "value": "1"
    }

Requiring both mainKey and secondaryKey parameters.

Get List of Values from User Defined Table

  • Description: Retrieves a list of values from a UDT using the getList function, available from CPI 15.70.

    • The currentAccountScope parameter defaults to true (limits to current account scope); set to false to load all data from disk.

  • Syntax:

    pepperi.api.userDefinedTables.getList({
      table: "<tableName>",
      mainKey: "<mainKey>" (optional),
      secondaryKey: "<secondaryKey>" (optional),
      currentAccountScope: <boolean>
    });
  • Example:

    pepperi.api.userDefinedTables.getList({
      table: "myTable",
      mainKey: "Item123",
      currentAccountScope: true
    });
  • Returns:

    {
      "success": true,
      "objects": [
        { "mainKey": "ABCD12", "secondaryKey": "GFT4", "value": "23.5" },
        { "mainKey": "ABCD12", "secondaryKey": "GFT5", "value": "5656.5" }
      ]
    }

Requires at least tableName. mainKey and secondaryKey are optional.

Note: Availale only from CPI 15.70.