JS Client API
  • Getting Started
  • Rule Engine Unique Functions
  • Custom Form Window Functions
  • Known Issues
  • Use Cases & Code Samples
  • 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
  • Get single object by unique key
  • Search list of objects by filter

Was this helpful?

  1. Retrieving Data

Retrieving Standard Resources

Data retrieval - standard resources

Get single object by unique key

To retrieve a single object use the get function for the desired resource

Only UUID is currently supported as a key

Supported Resources: accounts, transactions, activities, transactionLines, transactionScopeItems.

from CPI 15.85 supports also : items, catalogs, users, contacts.

pepperi.api.<resource>.get( { key: {UUID: "<UUID>"} , fields: [ <string array of relevant field names>] }

Example:

pepperi.api.activities.get({
     key: { UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" },
     fields: ["UUID", "ExternalID", "MyTSA"]
});

Returns the following object that can be used for the "update" functions :

{success: true, 
   object: 
   {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" ,
     ExternalID: "ABC123" , MyTSA: 34.56
 }}

Search list of objects by filter

To retrieve multiple objects use the search function for the desired resource - it returns the following object:

Supported resources: accounts, transactions, activities, transactionLines, allActivities.

from CPI 15.85 supports also : items, catalogs, users, contacts.

pepperi.api.<resource>.search (filter: { <filter object> }, sort : [ <array of sort objects>} , pageSize : <number>, page: <number>)

Example:

pepperi.api.activities.search (
{
fields: [ "UUID", "ExternalID" , "MyTSA"] ,
filter: { Operation : "AND", LeftNode: {ApiName: "APIName1", Operation : ">",
          Values : ["7"]},RightNode:{ApiName: "ApiName2",
          Operation: "InTheLast", Values: ["4","Weeks"]} } ,
sorting : [{Field: "MyTSA",Ascending: true},{Field: "MyTSA2",Ascending: true }]  , 
pageSize : 1000 , page: 1
});

Returns:

{success: true, objects: 
[ {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" , ExternalID: "abc123", MyTSA: 12.8},
  {UUID: "aefb5346-74ac-4041-8bb1-a76a3b5e734h" , ExternalID: "abc456", MyTSA: 34.5}
] }

Retrieve item's images:

TO BE DEVELOPED :

Add 12 new fields to items resource - both items.get and items.search functions.

The behavior is similar to attachments.get function = URL always returns URL , while URI field returns Base64 content when called from Mobile Device and URL when called from Web App. Field Names:

  1. ImageURL

  2. ImageURI

  3. ImageURL2

  4. ImageURI2

  5. ....Until 6 (Items resource supports up to 6 images per item)

PreviousUse Cases & Code SamplesNextRetrieving User Defined Tables

Last updated 5 years ago

Was this helpful?