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

Known Issues

PreviousUse Cases & Code SamplesNextRetrieving Standard Resources

Last updated 10 days ago

Was this helpful?

CtrlK
  • Overview
  • Issue Description

Was this helpful?

Overview

This guide addresses a known issues in the Pepperi JS Client Side API Rule Engine.


Issue Description

  • Problem: The Rule Engine currently does not support the Optional Chaining Operator (?.).

  • Impact: Using this operator, such as x?.success, may cause errors in UDFs, stopping script execution.

  • Recommendation: Avoid using the Optional Chaining Operator in Rule Engine scripts.

Incorrect Usage

let x = pepperi.api.userDefinedTables.getList({});
let data = x?.success ? x.objects : [];  // This will cause an error

Correct Workaround

let x = pepperi.api.userDefinedTables.getList({});
let data= x && x.success ? x.objects : []; // Safe alternative
  • Explanation: The workaround uses a conditional check (x && x.success) to safely access x.objects, defaulting to an empty array the condition fails.