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 line by unique key
  • Search list of Transaction Lines by filter
  • Search list of Transaction Lines by Transaction filter and Transaction Lines filter

Was this helpful?

  1. Retrieving Data

Retrieving Transaction Lines

Retrieving Lines of a Transaction (lines in the Transaction's Cart)

Get single line by unique key

Line UUID is currently the only key supported

pepperi.api.transactionLines.get(

{ key: {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8"} ,
 fields: [ "UnitsQuantity" , "Item.ExternalID"] } ) 

Returns:

{success: true, 
   object: 
   {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" ,
     UnitsQuantity: 34 , Item.ExternalID: "ABCD123"
 }}

Search list of Transaction Lines by filter

Example:

pepperi.api.transactionLines.search({
  fields: ["Transaction.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}
] }

Search list of Transaction Lines by Transaction filter and Transaction Lines filter

The purpose of this function is to enable fetching transaction lines of transactions not loaded yet to memory.

pepperi.api.transactionLines.search ({
fields: [ "UUID", "ExternalID" , "MyTSA"] ,
transactionFilter : { Operation : "AND", LeftNode: {ApiName: "APIName1", Operation : ">",
          Values : ["7"]},RightNode:{ApiName: "ApiName2",
          Operation: "InTheLast", Values: ["4","Weeks"]} }
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}
] }
PreviousRetrieving Items in Transaction ScopeNextADAL

Last updated 4 years ago

Was this helpful?