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. Updating Data

Adding Objects to Standard Resources

PreviousADALNextUpdating Standard resources

Last updated 17 days ago

Was this helpful?

CtrlK

Was this helpful?

Data Addition Methods

Adding a Single Object

  • Description: Adds a single object to the specified resource using the add function.

  • Supported Resources: accounts, transactions, activities, contacts

  • Requirements:

    • account Field (Mandatory except for accounts): Supports UUID and InternalID in the references object.

    • type Field:

      • Mandatory for transactions and activities.

      • Optional for accounts and contacts; defaults to the resource’s default type if omitted.

      • Must contain either type id or type name (ID takes precedence if both are provided).

    • Optional Fields:

      • originAccount (transactions and activities only): Supports InternalID and UUID.

      • catalog (mandatory for accounts, activities, and transactions with multiple catalogs): Supports InternalID, UUID, and catalog Name.

    • Workflow Behavior: For objects with workflow transitions, the object is created in the "new" status, with the New>>{Next Transition Step} initialized.

  • Syntax:

    pepperi.app.<resource name>.add({
      type: { InternalID: <id>, Name: "<name>" },
      references: { account: { UUID: "<UUID>" } }, // Optional: originAccount, catalog
      object: { <field1>: <value1>, <field2>: <value2> }
    });
  • Example:

    pepperi.app.transactions.add({
      type: { InternalID: 1234, Name: "Sales Order" },
      references: { account: { UUID: "acc123e-74ac-4041-8bb1-a76a3b5e78d8" } },
      object: { GrandTotal: 567.5, TSASubject: "This Object was created with the client api" }
    });
  • Returns:

    {
      "success": true,
      "id": "6e2803cd-b656-4d4f-8d21-f7cee7167350",
      "status": "added",
      "message": ""
    }