@celigo/api-specs 0.2.9 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/export.yml CHANGED
@@ -10080,45 +10080,10 @@ components:
10080
10080
  related rows. When false or omitted, related rows are grouped before processing.
10081
10081
  x-celigo-ai-guidance:
10082
10082
  - |-
10083
- skipGrouping:
10084
- Indicates whether to bypass the grouping of related records or transactions during processing,
10085
- allowing each item to be handled individually rather than aggregated into groups.
10086
- - |-
10087
- ## FIELD BEHAVIOR:
10088
- - When set to true, the system processes each record or transaction independently, without combining them into groups based on shared attributes.
10089
- - When set to false or omitted, related records or transactions are aggregated according to predefined grouping criteria (e.g., by customer, date, or transaction type) before processing.
10090
- - Influences how data is structured, summarized, and reported in outputs or passed to downstream systems.
10091
- - Affects the level of detail and granularity available in the processed data.
10092
- - |-
10093
- ## IMPLEMENTATION GUIDANCE:
10094
- - Utilize this flag to control processing granularity, especially when detailed, record-level analysis or reporting is required.
10095
- - Confirm that downstream systems, reports, or integrations can accommodate ungrouped data if skipGrouping is enabled.
10096
- - Assess the potential impact on system performance and data volume, as disabling grouping may significantly increase the number of processed items.
10097
- - Consider the use case carefully: grouping is generally preferred for summary reports, while skipping grouping suits detailed audits or troubleshooting.
10098
- - For `exportSelect` / `refreshableSelect` dropdowns backed by a NetSuite RESTlet, set `skipGrouping: true`: the UI's option mapper expects flat per-row results, and the platform otherwise wraps each row in its own grouping list (every option's `label` then renders as `undefined`).
10099
- - |-
10100
- ## EXAMPLES:
10101
- - skipGrouping: true — Processes each transaction separately, providing detailed, unaggregated data.
10102
- - skipGrouping: false — Groups transactions by customer or date, producing summarized results.
10103
- - skipGrouping omitted — Defaults to grouping enabled, aggregating related records.
10104
- - |-
10105
- ## IMPORTANT NOTES:
10106
- - Enabling skipGrouping can lead to increased processing time, higher memory usage, and larger output datasets.
10107
- - Some reports, dashboards, or integrations may require grouped data; verify compatibility before enabling this option.
10108
- - The default behavior is typically grouping enabled (skipGrouping = false) unless explicitly overridden.
10109
- - Changes to this setting may affect data consistency and comparability with previously generated reports.
10110
- - |-
10111
- ## DEPENDENCY CHAIN:
10112
- - Often depends on other properties that define grouping keys or criteria (e.g., groupBy fields).
10113
- - May interact with filtering, sorting, or pagination settings within the processing pipeline.
10114
- - Could influence or be influenced by aggregation functions or summary calculations applied downstream.
10115
- - |-
10116
- ## TECHNICAL DETAILS:
10117
- - Data type: Boolean.
10118
- - Default value: false (grouping enabled).
10119
- - Implemented as a conditional flag checked during the data aggregation phase.
10120
- - When true, bypasses aggregation logic and processes each record individually.
10121
- - Typically integrated into the processing workflow to toggle between grouped and ungrouped data handling.
10083
+ Set `true` for an ad-hoc RESTlet search (criteria and columns without a saved
10084
+ search): grouping needs the search sorted by the grouping key, and an unsorted ad-hoc
10085
+ search fails with `[search_not_sorted]`.
10086
+ - 'For `exportSelect` / `refreshableSelect` dropdowns backed by a NetSuite RESTlet, set `skipGrouping: true`: the UI''s option mapper expects flat per-row results, and the platform otherwise wraps each row in its own grouping list (every option''s `label` then renders as `undefined`).'
10122
10087
  statsOnly:
10123
10088
  type: boolean
10124
10089
  description: |-
@@ -10326,45 +10291,10 @@ components:
10326
10291
  - purchaseOrder
10327
10292
  x-celigo-ai-guidance:
10328
10293
  - |-
10329
- recordType specifies the type of NetSuite record that the RESTlet will interact with.
10330
- This property determines the schema, validation rules,
10331
- and operations applicable to the record within the NetSuite environment,
10332
- directly influencing how data is processed and managed by the RESTlet.
10333
- - |-
10334
- ## FIELD BEHAVIOR:
10335
- - Defines the specific NetSuite record type (e.g., customer, salesOrder, invoice) targeted by the RESTlet.
10336
- - Influences the structure and format of data payloads sent to and received from the RESTlet.
10337
- - Controls validation rules, mandatory fields, and available operations based on the selected record type.
10338
- - Affects permissions and access controls enforced during RESTlet execution, ensuring compliance with NetSuite security settings.
10339
- - Determines the applicable business logic and workflows triggered by the RESTlet for the specified record type.
10340
- - |-
10341
- ## IMPLEMENTATION GUIDANCE:
10342
- - Use the exact internal ID or script ID of the NetSuite record type as recognized by the NetSuite system to ensure accurate targeting.
10343
- - Validate the recordType value against the list of supported NetSuite record types to prevent runtime errors and ensure compatibility.
10344
- - Confirm that the RESTlet script has the necessary permissions and roles assigned to access and manipulate the specified record type.
10345
- - When handling multiple record types dynamically, implement conditional logic to accommodate differences in data structure and processing requirements.
10346
- - For custom record types, always use the script ID format (e.g., "customrecord_myCustomRecord") to avoid ambiguity.
10347
- - Test RESTlet behavior thoroughly after changing the recordType to verify correct handling of data and operations.
10348
- - |-
10349
- ## EXAMPLES:
10350
- - "customer"
10351
- - "salesOrder"
10352
- - "invoice"
10353
- - "employee"
10354
- - "customrecord_myCustomRecord"
10355
- - "vendor"
10356
- - "purchaseOrder"
10357
- - |-
10358
- ## IMPORTANT NOTES:
10359
- - The recordType must correspond to a valid and supported NetSuite record type; invalid values will cause API calls to fail.
10360
- - Custom record types require referencing by their script IDs, which typically start with "customrecord_".
10361
- - Modifying the recordType may necessitate updates to the RESTlet's codebase to handle different data schemas and business logic.
10362
- - Permissions and role restrictions in NetSuite can limit access to certain record types, impacting RESTlet functionality.
10363
- - Consistency in recordType usage is critical for maintaining data integrity and predictable RESTlet behavior.
10364
- - |-
10365
- ## DEPENDENCY CHAIN:
10366
- - Depends on the NetSuite environment's available record types and their configurations.
10367
- - Influences the RESTlet's data validation, processing logic, and response formatting.
10294
+ Saved searches over any transaction type (sales orders, purchase orders,
10295
+ invoices, ...) run with `recordType: "transaction"` and narrow the type through the
10296
+ search or a `criteria` row such as `{"field": "type", "operator": "anyof",
10297
+ "searchValue": ["PurchOrd"]}`.
10368
10298
  batchSize:
10369
10299
  type: number
10370
10300
  description: |-
@@ -10383,49 +10313,16 @@ components:
10383
10313
  saved search's current definition, so editing the search in NetSuite changes the
10384
10314
  export output without changing this ID.
10385
10315
  examples:
10386
- - '1234'
10387
- - '5678'
10388
- - '1001'
10389
- - '2002'
10316
+ - '9013'
10317
+ - customsearch_plan_velocity
10318
+ - '-1'
10390
10319
  x-celigo-ai-guidance:
10391
10320
  - |-
10392
- searchId: The unique identifier for a saved search in NetSuite,
10393
- used to specify which saved search the RESTlet should execute.
10394
- This ID corresponds to the internal ID assigned to saved searches within the NetSuite system.
10395
- It enables the RESTlet to run predefined queries and retrieve data based on the
10396
- saved search's criteria and configuration.
10397
- - |-
10398
- ## FIELD BEHAVIOR:
10399
- - Specifies the exact saved search to be executed by the RESTlet.
10400
- - Must correspond to a valid and existing saved search internal ID within the NetSuite account.
10401
- - Determines the dataset and filters applied when retrieving search results.
10402
- - Typically required when invoking the RESTlet to perform search operations.
10403
- - Influences the structure and content of the response based on the saved search definition.
10404
- - |-
10405
- ## IMPLEMENTATION GUIDANCE:
10406
- - Verify that the searchId matches an existing saved search internal ID in the target NetSuite environment.
10407
- - Validate the searchId format and existence before making the RESTlet call to prevent runtime errors.
10408
- - Use the internal ID as a string or numeric value consistent with NetSuite's conventions.
10409
- - Implement error handling for scenarios where the searchId is invalid, missing, or inaccessible due to permission restrictions.
10410
- - Ensure the integration role or user has appropriate permissions to access and execute the saved search.
10411
- - Consider caching or documenting frequently used searchIds to improve maintainability.
10412
- - |-
10413
- ## EXAMPLES:
10414
- - "1234" — a numeric internal ID representing a specific saved search.
10415
- - "5678" — another valid saved search internal ID.
10416
- - "1001" — an example of a saved search ID used to retrieve customer records.
10417
- - "2002" — a saved search ID configured to return transaction data.
10418
- - |-
10419
- ## IMPORTANT NOTES:
10420
- - The searchId must be accessible by the user or integration role making the RESTlet call; otherwise, access will be denied.
10421
- - Providing an incorrect or non-existent searchId will result in errors or empty search results.
10422
- - Permissions and sharing settings on the saved search directly affect the data returned by the RESTlet.
10423
- - The saved search must be properly configured with the desired filters, columns, and criteria to ensure meaningful results.
10424
- - Changes to the saved search (e.g., modifying filters or columns) will impact the RESTlet output without changing the searchId.
10425
- - |-
10426
- ## DEPENDENCY CHAIN:
10427
- - Depends on the existence of a saved search configured in the NetSuite account.
10428
- - Requires appropriate user or integration role permissions to access the saved search.
10321
+ Accepts the saved search's internal id (`"9013"`) or script id
10322
+ (`"customsearch_..."`). `"-1"` means no saved search: the RESTlet builds an ad-hoc
10323
+ search from `recordType` + `criteria` + `columns` (see `columns` — required in
10324
+ that mode, along with `netsuite.skipGrouping: true`). Omitting both `searchId`
10325
+ and `columns` fails with `[celigo_config_error] searchId or columns are required`.
10429
10326
  useSS2Restlets:
10430
10327
  type: boolean
10431
10328
  description: |-
@@ -10435,40 +10332,13 @@ components:
10435
10332
  creation-time-only constraint applies (see restletVersion).
10436
10333
  x-celigo-ai-guidance:
10437
10334
  - |-
10438
- useSS2Restlets:
10439
- > Specifies whether to use SuiteScript 2.0 RESTlets for API interactions instead
10440
- of SuiteScript 1.0 RESTlets.
10441
- This setting controls the version of RESTlets invoked during API communication with NetSuite,
10442
- impacting compatibility, performance, and available features.
10335
+ An authoring-time choice: set it when creating the step (true unless the user
10336
+ explicitly needs a legacy version). It cannot be toggled on a saved step — moving
10337
+ an existing step to a different version means recreating or cloning it.
10443
10338
  - |-
10444
- ## FIELD BEHAVIOR:
10445
- - Determines the RESTlet version used for all API interactions within the NetSuite integration.
10446
- - When set to `true`, the system exclusively uses SuiteScript 2.0 RESTlets.
10447
- - When set to `false` or omitted, SuiteScript 1.0 RESTlets are used by default.
10448
- - Influences the structure, capabilities, and response formats of API calls.
10449
- - |-
10450
- ## IMPLEMENTATION GUIDANCE:
10451
- - This is an authoring-time choice: set it when creating the step (true unless the user explicitly needs a legacy version). It cannot be toggled on a saved step — moving an existing step to a different version means recreating or cloning it.
10452
- - Verify that the integrator.io SuiteApp is installed in the target NetSuite environment when authoring SuiteScript 2.0 steps.
10453
- - When migrating by recreation, verify any SuiteScript hooks are written for the matching version before cutting over.
10454
- - |-
10455
- ## EXAMPLES:
10456
- - `true` — API calls will utilize SuiteScript 2.0 RESTlets, enabling modern scripting features.
10457
- - `false` — API calls will continue using legacy SuiteScript 1.0 RESTlets for backward compatibility.
10458
- - |-
10459
- ## IMPORTANT NOTES:
10460
- - SuiteScript 2.0 RESTlets support modular script architecture and ES6+ JavaScript features, improving maintainability and performance.
10461
- - Legacy RESTlets written in SuiteScript 1.0 may not be compatible with SuiteScript 2.0; migration or parallel support might be required.
10462
- - This setting is fixed once the step is saved (same creation-time-only constraint as restletVersion) — moving a step between RESTlet versions means recreating or cloning it, which can change API response formats and behaviors for downstream systems.
10463
- - Plan a version migration deliberately: recreate the step with the new version, verify any hooks are written for the matching SuiteScript version, and keep the old step until the new one is verified.
10464
- - |-
10465
- ## DEPENDENCY CHAIN:
10466
- - Depends on the deployment and availability of SuiteScript 2.0 RESTlets within the NetSuite account.
10467
- - Requires that the API client and integration logic support the RESTlet version selected.
10468
- - May depend on other configuration settings related to authentication and script permissions.
10469
- - |-
10470
- ## TECHNICAL DETAILS:
10471
- - SuiteScript 2.0 RESTlets use the AMD module format and support
10339
+ SuiteScript 2.0 steps need the integrator.io SuiteApp installed in the target
10340
+ NetSuite account, and any SuiteScript hooks must be written for the step's
10341
+ version — verify both before cutting a recreated step over.
10472
10342
  restletVersion:
10473
10343
  type: string
10474
10344
  enum:
@@ -10507,43 +10377,36 @@ components:
10507
10377
  criteria:
10508
10378
  type: array
10509
10379
  description: |-
10510
- Filter conditions that limit which records the RESTlet returns (live: an array of
10511
- field/operator/value conditions). Each condition pairs a field with an operator and
10512
- one or two comparison values.
10380
+ Filter conditions added on top of the saved search (the UI's "Additional search
10381
+ criteria"). Each condition pairs a search column with an operator and one or two
10382
+ comparison values, and the conditions are combined with AND — every one must match.
10513
10383
  x-celigo-ai-guidance:
10514
10384
  - |-
10515
- criteria:
10516
- > Defines the set of conditions or filters used to specify which records should
10517
- be retrieved or affected by the NetSuite RESTlet operation.
10518
- This property enables clients to precisely narrow down the dataset by applying
10519
- one or more criteria based on record fields,
10520
- comparison operators, and values,
10521
- supporting complex logical combinations to tailor the query results.
10522
- - |-
10523
- ## FIELD BEHAVIOR:
10524
- - Accepts a structured object or an array representing one or multiple filtering conditions.
10525
- - Supports logical operators such as AND, OR, and nested groupings to combine multiple criteria flexibly.
10526
- - Each criterion typically includes a field name, an operator (e.g., equals, contains, greaterThan), and a value or set of values.
10527
- - Enables filtering on various data types including strings, numbers, dates, and booleans.
10528
- - Used to limit the scope of data returned or manipulated by the RESTlet to only those records that meet the specified conditions.
10529
- - When omitted or empty, the RESTlet may return all records or apply default filtering behavior as defined by the implementation.
10530
- - |-
10531
- ## IMPLEMENTATION GUIDANCE:
10532
- - Validate the criteria structure rigorously to ensure it conforms to the expected schema before processing.
10533
- - Support nested criteria groups to allow complex and hierarchical filtering logic.
10534
- - Map criteria fields and operators accurately to corresponding NetSuite record fields and search operators, considering data types and operator compatibility.
10535
- - Handle empty or undefined criteria gracefully by returning all records or applying sensible default filters.
10536
- - Sanitize all input values to prevent injection attacks, malformed queries, or unexpected behavior.
10537
- - Provide clear error messages when criteria are invalid or unsupported.
10538
- - Optimize query performance by translating criteria into efficient NetSuite search queries.
10385
+ A flat list: each entry becomes one `search.createFilter({ name, join, operator,
10386
+ values, formula })` call and NetSuite ANDs the resulting filters. There is no
10387
+ logical-combinator or grouping property (`join` is NetSuite's related-record
10388
+ join, e.g. `customer`, not an AND/OR operator) — a group object such as
10389
+ `{"operator": "OR", "criteria": [...]}` is rejected with a 422 (`OR` is not a
10390
+ valid enum value for path `operator`).
10391
+ - |-
10392
+ OR or grouped logic belongs in ONE formula condition: `{"field": "formulanumeric",
10393
+ "operator": "equalto", "searchValue": 1, "formula": "CASE WHEN {tranid} =
10394
+ '{{poNumber}}' OR ({shipzip} = '{{zip}}' AND {shipaddress1} = '{{address1}}')
10395
+ THEN 1 ELSE 0 END"}`. The formula is a NetSuite (Oracle SQL) expression over
10396
+ `{searchColumn}` references and can carry Handlebars values from the incoming
10397
+ record. The alternative is a second lookup step filtered to run only when this
10398
+ one returned no record. Do not describe OR between rows as configurable.
10539
10399
  - |-
10540
- ## EXAMPLES:
10541
- - A single criterion filtering records where status equals "Open":
10542
- `{ "field": "status", "operator": "equals", "value": "Open" }`
10543
- - Multiple criteria combined with AND logic:
10544
- `[{"field": "status", "operator": "equals", "value": "Open"}, {"field": "priority", "operator": "greaterThan", "value": 2}]`
10545
- - Nested criteria combining OR and AND:
10546
- `{ "operator": "OR", "criteria": [ {"field": "status", "operator": "equals", "value": "Open"}, { "operator": "AND", "criteria": [ {"field": "priority", "operator": "greaterThan", "value":
10400
+ ## EXAMPLE
10401
+ ```json
10402
+ [
10403
+ {"field": "type", "operator": "anyof", "searchValue": ["PurchOrd"]},
10404
+ {"field": "mainline", "operator": "is", "searchValue": "F"},
10405
+ {"field": "tranid", "operator": "is", "searchValue": "{{poNumber}}"}
10406
+ ]
10407
+ ```
10408
+ `field` must be a search-column id for the record type (the SEARCH COLUMNS
10409
+ metadata block), not a body-field name — e.g. `shipaddress1`, not `shipaddr1`.
10547
10410
  items:
10548
10411
  type: object
10549
10412
  properties:
@@ -10559,241 +10422,178 @@ components:
10559
10422
  of the base record. Must match a join name NetSuite defines for the record type.
10560
10423
  operator:
10561
10424
  type: string
10425
+ enum:
10426
+ - after
10427
+ - allof
10428
+ - any
10429
+ - anyof
10430
+ - before
10431
+ - between
10432
+ - contains
10433
+ - doesnotcontain
10434
+ - doesnotstartwith
10435
+ - equalto
10436
+ - greaterthan
10437
+ - greaterthanorequalto
10438
+ - haskeywords
10439
+ - is
10440
+ - isempty
10441
+ - isnot
10442
+ - isnotempty
10443
+ - lessthan
10444
+ - lessthanorequalto
10445
+ - noneof
10446
+ - notafter
10447
+ - notallof
10448
+ - notbefore
10449
+ - notbetween
10450
+ - notequalto
10451
+ - notgreaterthan
10452
+ - notlessthan
10453
+ - notlessthanorequalto
10454
+ - noton
10455
+ - notonorafter
10456
+ - notonorbefore
10457
+ - notwithin
10458
+ - 'on'
10459
+ - onorafter
10460
+ - onorbefore
10461
+ - startswith
10462
+ - within
10463
+ x-enumDescriptions:
10464
+ after: Date column is after the value
10465
+ allof: Multi-select column contains every value in the array
10466
+ any: NetSuite's any operator for list and multi-select columns
10467
+ anyof: List or select column equals any value in the array
10468
+ before: Date column is before the value
10469
+ between: Numeric column lies between searchValue and searchValue2
10470
+ contains: Text column contains the substring
10471
+ doesnotcontain: Text column does not contain the substring
10472
+ doesnotstartwith: Text column does not start with the value
10473
+ equalto: Numeric column equals the value
10474
+ greaterthan: Numeric column is greater than the value
10475
+ greaterthanorequalto: Numeric column is greater than or equal to the value
10476
+ haskeywords: Text column contains the keywords
10477
+ is: Text or checkbox column equals the value exactly (checkboxes use T or F)
10478
+ isempty: Column has no value
10479
+ isnot: Text or checkbox column does not equal the value
10480
+ isnotempty: Column has a value
10481
+ lessthan: Numeric column is less than the value
10482
+ lessthanorequalto: Numeric column is less than or equal to the value
10483
+ noneof: List or select column equals none of the values in the array
10484
+ notafter: Date column is not after the value
10485
+ notallof: Multi-select column does not contain every value in the array
10486
+ notbefore: Date column is not before the value
10487
+ notbetween: Numeric column lies outside searchValue and searchValue2
10488
+ notequalto: Numeric column does not equal the value
10489
+ notgreaterthan: Numeric column is not greater than the value
10490
+ notlessthan: Numeric column is not less than the value
10491
+ notlessthanorequalto: Numeric column is not less than or equal to the value
10492
+ noton: Date column is not on the value
10493
+ notonorafter: Date column is not on or after the value
10494
+ notonorbefore: Date column is not on or before the value
10495
+ notwithin: Date column is outside the range
10496
+ 'on': Date column is on the value
10497
+ onorafter: Date column is on or after the value
10498
+ onorbefore: Date column is on or before the value
10499
+ startswith: Text column starts with the value
10500
+ within: Date column is within the range
10562
10501
  description: |-
10563
- Comparison operator applied between the field and the search value, using
10564
- NetSuite's search operator names (e.g. equals, contains, greaterThan).
10502
+ Comparison operator applied between the column and the search value, using
10503
+ NetSuite's lowercase search operator names. Which operators a column accepts
10504
+ depends on its data type.
10565
10505
  examples:
10566
- - operator
10506
+ - is
10507
+ - anyof
10508
+ - equalto
10567
10509
  x-celigo-ai-guidance:
10568
10510
  - |-
10569
- operator:
10570
- > Specifies the comparison operator used to evaluate the criteria in a NetSuite RESTlet request.
10571
- This operator determines how the field value is compared against the specified
10572
- criteria value(s) to filter or query records.
10573
- - |-
10574
- ## FIELD BEHAVIOR:
10575
- - Defines the type of comparison between a field and a value (e.g., equality, inequality, greater than).
10576
- - Influences the logic of the criteria evaluation in RESTlet queries.
10577
- - Supports various operators such as equals, not equals, greater than, less than, contains, etc.
10511
+ The server validates the value against this list and rejects anything else
10512
+ with a 422 enum error — including logical words such as `OR`; conditions are
10513
+ never joined through this property.
10578
10514
  - |-
10579
- ## IMPLEMENTATION GUIDANCE:
10580
- - Use valid NetSuite-supported operators to ensure correct query behavior.
10581
- - Match the operator type with the data type of the field being compared (e.g., use numeric operators for numeric fields).
10582
- - Combine multiple criteria with appropriate logical operators if needed.
10583
- - Validate operator values to prevent errors in RESTlet execution.
10584
- - |-
10585
- ## EXAMPLES:
10586
- - "operator": "is" (checks if the field value is equal to the specified value)
10587
- - "operator": "isnot" (checks if the field value is not equal to the specified value)
10588
- - "operator": "greaterthan" (checks if the field value is greater than the specified value)
10589
- - "operator": "contains" (checks if the field value contains the specified substring)
10590
- - |-
10591
- ## IMPORTANT NOTES:
10592
- - The operator must be compatible with the field type and the value provided.
10593
- - Incorrect operator usage can lead to unexpected query results or errors.
10594
- - Operators are case-sensitive and should match NetSuite's expected operator strings.
10595
- - |-
10596
- ## DEPENDENCY CHAIN:
10597
- - Depends on the field specified in the criteria to determine valid operators.
10598
- - Works in conjunction with the criteria value(s) to form a complete condition.
10599
- - May be combined with logical operators when multiple criteria are used.
10600
- - |-
10601
- ## TECHNICAL DETAILS:
10602
- - Typically represented as a string value in the RESTlet criteria JSON object.
10603
- - Supported operators align with NetSuite's SuiteScript search operators.
10604
- - Must conform to the list of operators recognized by the NetSuite RESTlet API.
10515
+ Numeric operators (`equalto`, `notequalto`, `greaterthan`, `lessthan`, the
10516
+ `...orequalto` / `not...` variants, `between`, `notbetween`) make the platform
10517
+ coerce a templated `searchValue` to a number, and NetSuite rejects them on text
10518
+ columns with `sss_invalid_srch_operator`. Compare text and checkbox columns
10519
+ with `is` / `isnot` and list or select columns with `anyof` / `noneof` (array
10520
+ `searchValue`).
10605
10521
  searchValue:
10606
- type: string
10607
- description: Value the criteria field is compared against when filtering records.
10522
+ description: |-
10523
+ Value the column is compared against — a string, a number, or an array of
10524
+ values for `anyof`-style operators. On lookup steps it may be a Handlebars
10525
+ expression rendered from the incoming record (for example `{{poNumber}}`).
10608
10526
  examples:
10609
- - Acme Corporation
10610
- - '2024-01-01'
10611
- - Pending
10527
+ - '{{poNumber}}'
10528
+ - F
10529
+ - - PurchOrd
10612
10530
  x-celigo-ai-guidance:
10613
10531
  - |-
10614
- searchValue:
10615
- The value used as the search criterion to filter results in the NetSuite RESTlet API.
10616
- This value is matched against the specified search field to retrieve relevant
10617
- records based on the search parameters provided.
10532
+ A Handlebars path the incoming record does not carry fails the render with
10533
+ `handlebars_template_parse_error` ("Failed to generate criteria.N.searchValue
10534
+ from template"). A standalone preview of a lookup that uses `{{...}}` here
10535
+ fails the same way — outside a flow run there is no record to render from;
10536
+ preview with a literal value or through a flow test run instead.
10618
10537
  - |-
10619
- ## FIELD BEHAVIOR:
10620
- - Acts as the primary input for filtering search results.
10621
- - Supports various data types depending on the search field (e.g., string, number, date).
10622
- - Used in conjunction with other search criteria to refine query results.
10623
- - Can be a partial or full match depending on the search configuration.
10624
- - |-
10625
- ## IMPLEMENTATION GUIDANCE:
10626
- - Ensure the value type matches the expected type of the search field.
10627
- - Validate the input to prevent injection attacks or malformed queries.
10628
- - Use appropriate encoding if the value contains special characters.
10629
- - Combine with logical operators or additional criteria for complex searches.
10630
- - |-
10631
- ## EXAMPLES:
10632
- - "Acme Corporation" for searching customer names.
10633
- - 1001 for searching by internal record ID.
10634
- - "2024-01-01" for searching records created on or after a specific date.
10635
- - "Pending" for filtering records by status.
10636
- - |-
10637
- ## IMPORTANT NOTES:
10638
- - The effectiveness of the search depends on the accuracy and format of the searchValue.
10639
- - Case sensitivity may vary based on the underlying NetSuite configuration.
10640
- - Large or complex search values may impact performance.
10641
- - Null or empty values may result in no filtering or return all records.
10642
- - |-
10643
- ## DEPENDENCY CHAIN:
10644
- - Depends on the searchField property to determine which field the searchValue applies to.
10645
- - Works alongside searchOperator to define how the searchValue is compared.
10646
- - Influences the results returned by the RESTlet endpoint.
10647
- - |-
10648
- ## TECHNICAL DETAILS:
10649
- - Typically passed as a string in the API request payload.
10650
- - May require serialization or formatting based on the API specification.
10651
- - Integrated into the NetSuite search query logic on the server side.
10652
- - Subject to NetSuite's search limitations and indexing capabilities.
10538
+ With a numeric `operator` the rendered value is coerced to a number before the
10539
+ search runs, so a template must resolve to something numeric.
10653
10540
  searchValue2:
10654
- type: string
10655
10541
  description: |-
10656
- Second comparison value for operators that take two values, such as "between"
10657
- and "not between". Omit when the operator needs only one value.
10542
+ Second comparison value for the two-value operators `between` and `notbetween`
10543
+ (the upper bound). Omit for every other operator.
10658
10544
  x-celigo-ai-guidance:
10659
10545
  - |-
10660
- searchValue2 is an optional property used to specify the second value in a
10661
- search criterion within the NetSuite RESTlet API.
10662
- It is typically used in conjunction with search operators that require two values,
10663
- such as "between" or "not between," to define a range or a pair of comparison values.
10664
- - |-
10665
- ## FIELD BEHAVIOR:
10666
- - Represents the second operand or value in a search condition.
10667
- - Used primarily with operators that require two values (e.g., "between", "not between").
10668
- - Optional field; may be omitted if the operator only requires a single value.
10669
- - Works alongside searchValue (the first value) to form a complete search criterion.
10670
- - |-
10671
- ## IMPLEMENTATION GUIDANCE:
10672
- - Ensure that searchValue2 is provided only when the selected operator requires two values.
10673
- - Validate the data type of searchValue2 to match the expected type for the field being searched (e.g., date, number, string).
10674
- - When using range-based operators, searchValue2 should represent the upper bound or second boundary of the range.
10675
- - If the operator does not require a second value, omit this property to avoid errors.
10676
- - |-
10677
- ## EXAMPLES:
10678
- - For a date range search: searchValue = "2023-01-01", searchValue2 = "2023-12-31" with operator "between".
10679
- - For a numeric range: searchValue = 100, searchValue2 = 200 with operator "between".
10680
- - For a "not between" operator: searchValue = 50, searchValue2 = 100.
10681
- - |-
10682
- ## IMPORTANT NOTES:
10683
- - Providing searchValue2 without a compatible operator may result in an invalid search query.
10684
- - The data type and format of searchValue2 must be consistent with searchValue and the field being queried.
10685
- - This property is ignored if the operator only requires a single value.
10686
- - Proper validation and error handling should be implemented when processing this field.
10687
- - |-
10688
- ## DEPENDENCY CHAIN:
10689
- - Dependent on the "operator" property within the same search criterion.
10690
- - Works in conjunction with "searchValue" to define the search condition.
10691
- - Part of the "criteria" array or object in the NetSuite RESTlet search request.
10692
- - |-
10693
- ## TECHNICAL DETAILS:
10694
- - Data type varies depending on the field being searched (string, number, date, etc.).
10695
- - Typically serialized as a JSON property in the RESTlet request payload.
10696
- - Must conform to the expected format for the field and operator to avoid API errors.
10697
- - Used internally by NetSuite to construct the appropriate
10546
+ Same typing as `searchValue`: a literal or a Handlebars expression, coerced to
10547
+ a number for the numeric two-value operators.
10698
10548
  formula:
10699
10549
  type: string
10700
10550
  description: |-
10701
10551
  NetSuite formula expression used as the filter condition, for criteria that
10702
10552
  standard field-operator-value comparisons can't express.
10703
10553
  examples:
10704
- - CASE WHEN {status} =
10705
- - TO_DATE({createddate}) >= TO_DATE(
10706
- - NVL({amount}, 0) > 1000
10554
+ - CASE WHEN {quantity} > 0 THEN 1 ELSE 0 END
10555
+ - NVL({amount}, 0)
10556
+ - TO_DATE({trandate})
10707
10557
  x-celigo-ai-guidance:
10708
10558
  - |-
10709
- formula:
10710
- > A string representing a custom formula used to define criteria for filtering
10711
- or querying data within the NetSuite RESTlet API.
10712
- This formula allows users to specify complex conditions using NetSuite's formula syntax,
10713
- enabling advanced and flexible data retrieval.
10559
+ Used with a formula column in `field` (`formulanumeric` or `formulatext`):
10560
+ NetSuite evaluates this expression per record and `operator` / `searchValue`
10561
+ compare its result. `formulanumeric` `equalto` `1` with `CASE WHEN <condition>
10562
+ THEN 1 ELSE 0 END` turns any boolean condition — including OR and grouping
10563
+ across columns — into one criterion, which is the only way to express OR in
10564
+ this array.
10714
10565
  - |-
10715
- ## FIELD BEHAVIOR:
10716
- - Accepts a formula expression as a string that defines custom filtering logic.
10717
- - Used to create dynamic and complex criteria beyond standard field-value comparisons.
10718
- - Evaluated by the NetSuite backend to filter records according to the specified logic.
10719
- - Can incorporate NetSuite formula functions, operators, and field references.
10720
- - |-
10721
- ## IMPLEMENTATION GUIDANCE:
10722
- - Ensure the formula syntax complies with NetSuite's formula language and supported functions.
10723
- - Validate the formula string before submission to avoid runtime errors.
10724
- - Use this field when standard criteria fields are insufficient for the required filtering.
10725
- - Combine with other criteria fields as needed to build comprehensive queries.
10726
- - |-
10727
- ## EXAMPLES:
10728
- - "CASE WHEN {status} = 'Open' THEN 1 ELSE 0 END = 1"
10729
- - "TO_DATE({createddate}) >= TO_DATE('2023-01-01')"
10730
- - "NVL({amount}, 0) > 1000"
10731
- - |-
10732
- ## IMPORTANT NOTES:
10733
- - Incorrect or invalid formulas may cause the API request to fail or return errors.
10734
- - The formula must be compatible with the context of the query and the fields available.
10735
- - Performance may be impacted if complex formulas are used extensively.
10736
- - Formula evaluation is subject to NetSuite's formula engine capabilities and limitations.
10737
- - |-
10738
- ## DEPENDENCY CHAIN:
10739
- - Depends on the availability of fields referenced within the formula.
10740
- - Works in conjunction with other criteria properties in the request.
10741
- - Requires understanding of NetSuite's formula syntax and functions.
10742
- - |-
10743
- ## TECHNICAL DETAILS:
10744
- - Data type: string.
10745
- - Supports NetSuite formula syntax including SQL-like expressions and functions.
10746
- - Evaluated server-side during the processing of the RESTlet request.
10747
- - Must be URL-encoded if included in query parameters of HTTP requests.
10566
+ Oracle SQL syntax: `{searchColumn}` references, single-quoted string literals,
10567
+ `CASE` / `NVL` / `TO_DATE`; a Handlebars value from the incoming record can be
10568
+ embedded (`{tranid} = '{{poNumber}}'`). A formula that evaluates false for
10569
+ every record returns no rows with no error, so verify the expression with a
10570
+ preview that is expected to return records.
10748
10571
  columns:
10749
10572
  type: array
10750
10573
  description: |-
10751
- Columns (record fields) the RESTlet returns for each matching record (live: an array
10752
- of column descriptors). When omitted, all available columns for the record type are
10753
- returned.
10574
+ Search columns the RESTlet returns for each matching record. With a saved search,
10575
+ omit this to return the search's own result columns; an ad-hoc search (no
10576
+ `searchId`) must list its columns here.
10754
10577
  x-celigo-ai-guidance:
10755
10578
  - |-
10756
- columns:
10757
- > Specifies the set of columns (fields) to be retrieved or manipulated in the
10758
- NetSuite RESTlet operation.
10759
- This property defines which specific fields from the records should be included
10760
- in the response or used during processing,
10761
- enabling precise control over the data returned or affected.
10762
- By selecting only relevant columns,
10763
- it helps optimize performance and reduce payload size,
10764
- ensuring efficient data handling tailored to the operation's requirements.
10765
- - |-
10766
- ## FIELD BEHAVIOR:
10767
- - Determines the exact fields (columns) to be included in data retrieval, update, or manipulation operations.
10768
- - Supports specifying multiple columns to customize the dataset returned or processed.
10769
- - Limits the data payload by including only the specified columns, improving performance and reducing bandwidth.
10770
- - Influences the structure, content, and size of the response from the RESTlet.
10771
- - If omitted, defaults to retrieving all available columns for the target record type, which may impact performance.
10772
- - Columns specified must be valid and accessible for the target record type to avoid errors.
10773
- - |-
10774
- ## IMPLEMENTATION GUIDANCE:
10775
- - Accepts an array or list of column identifiers, which can be simple strings or objects with detailed specifications (e.g., `{ name: "fieldname" }`).
10776
- - Column identifiers should correspond exactly to valid NetSuite record field names or internal IDs.
10777
- - Validate column names against the target record schema before execution to prevent runtime errors.
10778
- - Use this property to optimize RESTlet calls by limiting data to only necessary fields, especially in large datasets.
10779
- - When specifying complex columns (e.g., joined fields or formula fields), ensure the correct syntax and structure are used.
10780
- - Consider the permissions and roles associated with the RESTlet user to ensure access to the specified columns.
10579
+ Entries are objects keyed by `name` — `[{"name": "internalid"}, {"name":
10580
+ "tranid"}]`. Plain strings fail with a 422 `ObjectParameterError`; objects keyed by
10581
+ `_id` fail with a 422 `BSONError` (`_id` is the server's own subdocument id).
10582
+ Omitting both `columns` and `searchId` fails with `[celigo_config_error] searchId
10583
+ or columns are required`.
10781
10584
  - |-
10782
- ## EXAMPLES:
10783
- - `["internalid", "entityid", "email"]` — retrieves basic identifying and contact fields.
10784
- - `[ { name: "internalid" }, { name: "entityid" }, { name: "email" } ]` — object notation for specifying columns.
10785
- - `["tranid", "amount", "status"]` — retrieves transaction-specific fields.
10786
- - `[ { name: "custbody_custom_field" }, { name: "createddate" } ]` — includes custom and system fields.
10787
- - `["item", "quantity", "rate"]` — fields relevant to item records or line items.
10788
- - |-
10789
- ## IMPORTANT NOTES:
10790
- - Omitting the `columns` property typically
10585
+ Each `name` must be a search column id for the `recordType` (the SEARCH COLUMNS
10586
+ metadata block), not a body-field id — `shipaddress1`, not `shipaddr1`. Set
10587
+ `label` to control the property name in the exported record.
10791
10588
  items:
10792
10589
  type: object
10793
10590
  properties:
10794
10591
  _id:
10795
10592
  type: string
10796
- description: Column field id (NetSuite field internal id).
10593
+ readOnly: true
10594
+ description: |-
10595
+ Subdocument id the server assigns to the column entry on save. Not a NetSuite
10596
+ field id — never set it when authoring.
10797
10597
  name:
10798
10598
  type: string
10799
10599
  description: Column field name as referenced in the search.
@@ -10843,105 +10643,47 @@ components:
10843
10643
  - vendor
10844
10644
  summary:
10845
10645
  type: string
10846
- description: |-
10847
- Aggregation function applied to this column in a saved search
10848
- (e.g. SUM, COUNT, AVG, MIN, MAX).
10646
+ enum:
10647
+ - group
10648
+ - sum
10649
+ - count
10650
+ - avg
10651
+ - min
10652
+ - max
10653
+ x-enumDescriptions:
10654
+ group: Group results by this column's value
10655
+ sum: Sum of the column across the grouped rows
10656
+ count: Count of grouped rows
10657
+ avg: Average of the column across the grouped rows
10658
+ min: Minimum value across the grouped rows
10659
+ max: Maximum value across the grouped rows
10660
+ x-lowercase: true
10661
+ description: Summary type applied to this column, turning the search into a summary search.
10849
10662
  formula:
10850
10663
  type: string
10851
10664
  description: |-
10852
10665
  NetSuite formula expression that computes this column's value at runtime, such
10853
10666
  as a CASE statement or date formatting, instead of reading a stored field.
10854
10667
  examples:
10855
- - CASE WHEN {status} =
10668
+ - CASE WHEN {status} = 'Open' THEN 1 ELSE 0 END
10856
10669
  - NVL({amount}, 0) * 0.1
10857
- - TO_CHAR({trandate},
10670
+ - TO_CHAR({trandate}, 'YYYY-MM-DD')
10858
10671
  x-celigo-ai-guidance:
10859
10672
  - |-
10860
- ## IMPORTANT NOTES:
10861
- - The formula must be compatible with the context in which it is used (e.g., search column, RESTlet).
10862
- - Incorrect formulas can cause runtime errors or unexpected results.
10863
- - Some functions or operators may not be supported depending on the NetSuite version or API context.
10864
- - Formula evaluation respects user permissions and data visibility.
10865
- - |-
10866
- ## DEPENDENCY CHAIN:
10867
- - Depends on the availability of referenced fields within the record or search context.
10868
- - Relies on NetSuite's formula parsing and evaluation engine.
10869
- - Interacts with the RESTlet execution environment to produce output.
10870
- - |-
10871
- ## TECHNICAL DETAILS:
10872
- - Data type: string containing a formula expression.
10873
- - Supports NetSuite formula syntax including SQL-like CASE statements, arithmetic operations, and built-in functions.
10874
- - Evaluated server-side during RESTlet execution or saved search processing.
10875
- - |-
10876
- formula:
10877
- > A string representing a custom formula used to calculate or derive values
10878
- dynamically within the context of the NetSuite RESTlet columns.
10879
- This formula can include field references, operators,
10880
- and functions supported by NetSuite's formula syntax to perform computations or
10881
- conditional logic on record data.
10882
- - |-
10883
- ## FIELD BEHAVIOR:
10884
- - Accepts a formula expression as a string that defines how to compute the column's value.
10885
- - Can reference other fields, constants, and use NetSuite-supported functions and operators.
10886
- - Evaluated at runtime to produce dynamic results based on the current record data.
10887
- - Used primarily in saved searches, reports, or RESTlet responses to customize output.
10888
- - |-
10889
- ## IMPLEMENTATION GUIDANCE:
10890
- - Ensure the formula syntax complies with NetSuite's formula language and supported functions.
10891
- - Validate the formula string to prevent errors during execution.
10892
- - Use field IDs or aliases correctly within the formula to reference data fields.
10893
- - Test formulas thoroughly in NetSuite UI before deploying via RESTlet to ensure correctness.
10894
- - Consider performance implications of complex formulas on large datasets.
10895
- - |-
10896
- ## EXAMPLES:
10897
- - "CASE WHEN {status} = 'Open' THEN 1 ELSE 0 END" — returns 1 if status is Open, else 0.
10898
- - "NVL({amount}, 0) * 0.1" — calculates 10% of the amount, treating null as zero.
10899
- - "TO_CHAR({trandate}, 'YYYY-MM-DD')" — formats the transaction date as a string.
10673
+ Use with a formula column in `name` (`formulatext`, `formulanumeric`,
10674
+ `formuladate`, ...) and give the entry a `label` — the label becomes the
10675
+ exported record's property name. Oracle SQL syntax over `{searchColumn}`
10676
+ references; string literals use single quotes.
10900
10677
  label:
10901
10678
  type: string
10902
10679
  description: |-
10903
- Display name for the column in search results and reports. Purely cosmetic; it
10904
- does not affect the underlying data.
10680
+ Display name for the column; it becomes the property name of the column's value
10681
+ in each exported record.
10905
10682
  examples:
10906
10683
  - Customer Name
10907
10684
  - Invoice Date
10908
10685
  - Total Amount
10909
10686
  - Status
10910
- x-celigo-ai-guidance:
10911
- - |-
10912
- label:
10913
- | The display name or title of the column as it appears in the user interface or reports.
10914
- - |-
10915
- ## FIELD BEHAVIOR:
10916
- - Represents the human-readable name for a column in a dataset or report.
10917
- - Used to identify the column in UI elements such as tables, forms, or export files.
10918
- - Should be concise yet descriptive enough to convey the column's content.
10919
- - |-
10920
- ## IMPLEMENTATION GUIDANCE:
10921
- - Ensure the label is localized if the application supports multiple languages.
10922
- - Avoid using technical jargon; prefer user-friendly terminology.
10923
- - Keep the label length reasonable to prevent UI truncation.
10924
- - Update the label consistently when the underlying data or purpose changes.
10925
- - |-
10926
- ## EXAMPLES:
10927
- - "Customer Name"
10928
- - "Invoice Date"
10929
- - "Total Amount"
10930
- - "Status"
10931
- - |-
10932
- ## IMPORTANT NOTES:
10933
- - The label does not affect the data or the column's functionality; it is purely for display.
10934
- - Changing the label does not impact data processing or storage.
10935
- - Labels should be unique within the same context to avoid confusion.
10936
- - |-
10937
- ## DEPENDENCY CHAIN:
10938
- - Depends on the column definition within the dataset or report configuration.
10939
- - May be linked to localization resources if internationalization is supported.
10940
- - |-
10941
- ## TECHNICAL DETAILS:
10942
- - Typically a string data type.
10943
- - May support Unicode characters for internationalization.
10944
- - Stored as metadata associated with the column definition in the system.
10945
10687
  sort:
10946
10688
  type: boolean
10947
10689
  description: When true, query results are sorted by this column's values.
@@ -10960,277 +10702,53 @@ components:
10960
10702
  properties:
10961
10703
  batchSize:
10962
10704
  type: number
10963
- description: Number of records processed per batch when the RESTlet hook runs.
10964
- x-celigo-ai-guidance:
10965
- - |-
10966
- batchSize specifies the number of records or items to be processed in a single
10967
- batch during the execution of the NetSuite RESTlet hook.
10968
- This parameter helps control the workload size for each batch operation,
10969
- optimizing performance and resource utilization by balancing processing
10970
- efficiency and system constraints.
10971
- - |-
10972
- ## FIELD BEHAVIOR:
10973
- - Determines the maximum number of records or items processed in one batch cycle.
10974
- - Directly influences the frequency and duration of batch processing operations.
10975
- - Helps manage memory consumption and processing time by limiting the batch workload.
10976
- - Affects overall throughput and latency of batch operations, impacting system responsiveness.
10977
- - Controls how data is segmented and processed in discrete units during RESTlet execution.
10978
- - |-
10979
- ## IMPLEMENTATION GUIDANCE:
10980
- - Configure batchSize based on the system's processing capacity, expected data volume, and performance goals.
10981
- - Use smaller batch sizes in environments with limited resources or strict execution time limits to prevent timeouts.
10982
- - Larger batch sizes can improve throughput by reducing the number of batch cycles but may increase individual batch processing time and risk of hitting governance limits.
10983
- - Always validate that batchSize is a positive integer greater than zero to ensure proper operation.
10984
- - Take into account NetSuite API governance limits, such as usage units and execution time, when determining batchSize.
10985
- - Monitor system performance and adjust batchSize dynamically if possible to optimize processing efficiency.
10986
- - Ensure batchSize aligns with other batch-related configurations to maintain consistency and predictable behavior.
10987
- - |-
10988
- ## EXAMPLES:
10989
- - batchSize: 100 — processes 100 records per batch, balancing throughput and resource use.
10990
- - batchSize: 500 — processes 500 records per batch for higher throughput in robust environments.
10991
- - batchSize: 10 — processes 10 records per batch for fine-grained control and minimal resource impact.
10992
- - batchSize: 1 — processes records individually, useful for debugging or very resource-sensitive scenarios.
10993
- - |-
10994
- ## IMPORTANT NOTES:
10995
- - Excessively high batchSize values may cause processing timeouts, exceed NetSuite governance limits, or lead to memory exhaustion.
10996
- - Very low batchSize values can result in inefficient processing due to increased overhead and more frequent batch invocations.
10997
- - The optimal batchSize is context-dependent and should be determined through testing and monitoring.
10998
- - batchSize should be consistent with other batch processing parameters to avoid conflicts or unexpected behavior.
10999
- - Changes to batchSize may require adjustments in error handling and retry logic to accommodate different batch sizes.
11000
- - |-
11001
- ## DEPENDENCY CHAIN:
11002
- - Depends on the batch processing logic implemented within the RESTlet hook.
10705
+ description: |-
10706
+ Legacy location of the RESTlet page size; `restlet.batchSize` is the current
10707
+ field and takes precedence when both are set.
11003
10708
  preSend:
11004
10709
  type: object
11005
10710
  properties:
11006
10711
  fileInternalId:
11007
10712
  type: string
11008
- description: Internal ID of the file in the NetSuite file cabinet that the preSend hook references.
10713
+ description: |-
10714
+ Internal ID of the JavaScript file in the NetSuite File Cabinet that defines
10715
+ the hook function. Must be readable by the role behind the export's connection.
11009
10716
  examples:
11010
10717
  - '12345'
11011
- - '67890'
11012
- - file_98765
11013
- x-celigo-ai-guidance:
11014
- - |-
11015
- fileInternalId:
11016
- The unique internal identifier assigned to a file within the NetSuite system.
11017
- This identifier is used to precisely reference and manipulate a specific file
11018
- during API operations,
11019
- particularly within pre-send processing hooks in RESTlets.
11020
- It ensures accurate targeting of file resources by uniquely identifying files
11021
- stored in the NetSuite file cabinet.
11022
- - |-
11023
- ## FIELD BEHAVIOR:
11024
- - Represents a unique numeric or alphanumeric identifier assigned by NetSuite to each file.
11025
- - Used to retrieve, update, or reference a file during the preSend hook execution.
11026
- - Must correspond to an existing file within the NetSuite file cabinet.
11027
- - Immutable throughout the file's lifecycle; remains constant unless the file is deleted and recreated.
11028
- - Serves as a key reference for file-related operations in automated workflows and integrations.
11029
- - |-
11030
- ## IMPLEMENTATION GUIDANCE:
11031
- - Always validate that the fileInternalId exists and is accessible before performing operations.
11032
- - Use this ID to fetch file metadata, content, or perform updates within the preSend hook.
11033
- - Implement error handling to manage cases where the fileInternalId does not correspond to a valid or accessible file.
11034
- - Ensure that the executing user or integration has the necessary permissions to access the file referenced by this ID.
11035
- - Avoid hardcoding this ID; retrieve dynamically when possible to maintain flexibility and accuracy.
11036
- - |-
11037
- ## EXAMPLES:
11038
- - 12345
11039
- - "67890"
11040
- - "file_98765"
11041
- - |-
11042
- ## IMPORTANT NOTES:
11043
- - The fileInternalId is specific to each NetSuite account and environment; it is not globally unique across different accounts.
11044
- - Do not expose this identifier publicly, as it may reveal sensitive internal system details.
11045
- - Modifications to the file's name, location, or metadata do not affect the internal ID.
11046
- - This ID is essential for linking files reliably in automated processes, integrations, and RESTlet hooks.
11047
- - Deleting and recreating a file will result in a new fileInternalId.
11048
- - |-
11049
- ## DEPENDENCY CHAIN:
11050
- - Depends on the existence of the file within the NetSuite file cabinet.
11051
- - Requires appropriate permissions to access or manipulate the file.
11052
- - Utilized within preSend hooks to reference files accurately during API operations.
11053
- - |-
11054
- ## TECHNICAL DETAILS:
11055
- - Typically a numeric or alphanumeric string assigned by NetSuite upon file creation.
11056
- - Stored internally within NetSuite's database as the primary key for file records.
11057
- - Used as a parameter in RESTlet API calls to identify and operate on specific files.
11058
- - Immutable identifier that does not change unless the file is deleted and recreated.
10718
+ - '6398'
11059
10719
  function:
11060
10720
  type: string
11061
10721
  description: |-
11062
- Name of the function invoked as the preSend hook. The function can modify
11063
- the payload immediately before it is sent.
10722
+ Name of the global function in that file that NetSuite invokes as the pre
10723
+ send hook.
11064
10724
  examples:
11065
- - sanitizePayload
11066
- - addAuthenticationHeaders
11067
- - transformRequestData
11068
- - logRequestDetails
11069
- x-celigo-ai-guidance:
11070
- - |-
11071
- function:
11072
- > Specifies the name of the custom function to be invoked during the preSend
11073
- hook phase in the NetSuite RESTlet integration.
11074
- This function enables developers to implement custom logic for processing or
11075
- modifying the request payload immediately before it is dispatched to the
11076
- NetSuite RESTlet endpoint.
11077
- It serves as a critical extension point for tailoring request data,
11078
- adding headers, sanitizing inputs,
11079
- or performing any preparatory steps necessary to meet integration requirements.
11080
- - |-
11081
- ## FIELD BEHAVIOR:
11082
- - Identifies the exact function to execute during the preSend hook phase.
11083
- - Allows customization and transformation of the outgoing request payload or context.
11084
- - The specified function is called synchronously or asynchronously depending on implementation support.
11085
- - Modifications made by this function directly affect the data sent to the NetSuite RESTlet.
11086
- - Must reference a valid, accessible function within the integration's runtime environment.
11087
- - |-
11088
- ## IMPLEMENTATION GUIDANCE:
11089
- - Confirm that the function name matches a defined and exported function within the integration codebase.
11090
- - The function should accept the current request payload or context as input and return the modified payload or context.
11091
- - Implement robust error handling within the function to avoid unhandled exceptions that could disrupt the request flow.
11092
- - Optimize the function for performance to minimize latency in request processing.
11093
- - If asynchronous operations are supported, ensure proper handling of promises or callbacks.
11094
- - Document the function's behavior clearly to facilitate maintenance and future updates.
11095
- - |-
11096
- ## EXAMPLES:
11097
- - "sanitizePayload" — cleans and validates request data before sending.
11098
- - "addAuthenticationHeaders" — injects necessary authentication tokens or headers.
11099
- - "transformRequestData" — restructures or enriches the payload to match API expectations.
11100
- - "logRequestDetails" — captures request metadata for auditing or debugging purposes.
11101
- - |-
11102
- ## IMPORTANT NOTES:
11103
- - The function must be correctly implemented and accessible; otherwise, runtime errors will occur.
11104
- - This hook executes immediately before the request is sent, so any changes here directly impact the outgoing data.
11105
- - Ensure that the function's side effects do not unintentionally alter unrelated parts of the request or integration state.
11106
- - If asynchronous processing is used, verify that the integration framework supports it to avoid unexpected behavior.
11107
- - Testing the function thoroughly is critical to ensure reliable integration behavior.
11108
- - |-
11109
- ## DEPENDENCY CHAIN:
11110
- - Requires the preSend hook to be enabled and properly configured in the integration settings.
11111
- - Depends on the presence of the named
10725
+ - preSendHookScheduledExport
10726
+ - appendCustomerEmail
11112
10727
  configuration:
11113
10728
  type: object
11114
- description: Settings that control the preSend hook's behavior.
11115
- x-celigo-ai-guidance:
11116
- - '## IMPORTANT'
11117
- - |-
11118
- configuration:
11119
- > An object containing configuration settings that influence the behavior of the
11120
- preSend hook in the NetSuite RESTlet integration.
11121
- This object serves as a centralized control point for customizing how requests
11122
- are processed and modified before being sent to the NetSuite RESTlet endpoint.
11123
- It can include a variety of parameters such as authentication credentials,
11124
- logging preferences, request modification flags, timeout settings,
11125
- retry policies,
11126
- and feature toggles that tailor the preSend hook's operation to specific integration needs.
11127
- - |-
11128
- ## FIELD BEHAVIOR:
11129
- - Holds key-value pairs that define how the preSend hook processes and modifies outgoing requests.
11130
- - Can include settings such as authentication parameters (e.g., tokens, API keys), request modification flags (e.g., header adjustments), logging options (e.g., enable/disable logging), timeout durations, retry counts, and feature toggles.
11131
- - Is accessed and potentially updated dynamically during the execution of the preSend hook to adapt request handling based on current context or conditions.
11132
- - Influences the flow and outcome of the preSend hook, potentially altering request payloads, headers, or other metadata before transmission.
11133
- - |-
11134
- ## IMPLEMENTATION GUIDANCE:
11135
- - Define clear, descriptive, and consistent keys within the configuration object to avoid ambiguity and ensure maintainability.
11136
- - Validate all configuration values rigorously before applying them to prevent runtime errors or unexpected behavior.
11137
- - Use this object to centralize control over preSend hook behavior, enabling easier updates, debugging, and feature management.
11138
- - Document all possible configuration options, their expected data types, default values, and their specific effects on the preSend hook's operation.
11139
- - Ensure sensitive information within the configuration (e.g., authentication tokens) is handled securely, following best practices for encryption and access control.
11140
- - Consider versioning the configuration schema if multiple versions of the preSend hook or integration exist.
11141
- - |-
11142
- ## EXAMPLES:
11143
- - `{ "enableLogging": true, "authToken": "abc123", "modifyHeaders": false }`
11144
- - `{ "retryCount": 3, "timeout": 5000 }`
11145
- - `{ "useSandbox": true, "customHeader": "X-Custom-Value" }`
11146
- - `{ "authenticationType": "OAuth2", "refreshToken": "xyz789", "logLevel": "verbose" }`
11147
- - `{ "enableCaching": false, "maxRetries": 5, "requestPriority": "high" }`
10729
+ description: |-
10730
+ Free-form JSON stored with the hook reference for the script's own use. Custom
10731
+ settings in scope for the export are passed to the function separately as
10732
+ `options.settings`.
11148
10733
  description: |-
11149
- Hook invoked immediately before the payload is sent, allowing custom logic to
11150
- modify or validate it.
10734
+ SuiteScript hook that runs inside NetSuite after a page of records is collected
10735
+ and before it is sent to the Celigo platform.
11151
10736
  x-celigo-ai-guidance:
11152
10737
  - |-
11153
- preSend is a hook function that is executed immediately before a RESTlet sends a
11154
- response back to the client.
11155
- It allows for last-minute modifications or logging of the response data,
11156
- enabling customization of the output or performing additional processing steps
11157
- prior to transmission.
11158
- This hook provides a critical interception point to ensure the response adheres
11159
- to business rules,
11160
- compliance requirements,
11161
- or client-specific formatting before it leaves the server.
11162
- - |-
11163
- ## FIELD BEHAVIOR:
11164
- - Invoked right before the RESTlet response is sent to the client.
11165
- - Receives the response data as input and can modify it.
11166
- - Can be used to log, audit, or transform the response payload.
11167
- - Should return the final response object to be sent.
11168
- - Supports both synchronous and asynchronous execution depending on the implementation.
11169
- - Any changes made here directly impact the final output received by the client.
11170
- - |-
11171
- ## IMPLEMENTATION GUIDANCE:
11172
- - Implement as a synchronous or asynchronous function depending on the environment and use case.
11173
- - Ensure any modifications maintain the expected response format and data integrity.
11174
- - Avoid long-running or blocking operations to prevent delaying the response delivery.
11175
- - Handle errors gracefully within the hook to prevent disrupting the overall RESTlet response flow.
11176
- - Validate the modified response to ensure it complies with API schema and client expectations.
11177
- - Use this hook to enforce security measures such as masking sensitive data or adding audit trails.
10738
+ The function receives one `options` argument — `data` (the page of records),
10739
+ `recordType`, `searchId`, `skipGrouping`, `delta`, `once`, `_exportId`,
10740
+ `_connectionId`, `_flowId`, `_integrationId`, `settings`, `testMode` — and must
10741
+ return `{ data, errors, errorsAndRetryData }` (`errorsAndRetryData` items are
10742
+ `{retryData: <record>, errors: [<error>]}`). Throwing stops the flow.
11178
10743
  - |-
11179
- ## EXAMPLES:
11180
- - Adding a timestamp or metadata (e.g., request ID, processing duration) to the response object.
11181
- - Masking or removing sensitive information (e.g., personal identifiers, confidential fields) from the response.
11182
- - Logging response details for auditing or debugging purposes.
11183
- - Transforming response data structure or formatting to match client-specific requirements.
11184
- - Injecting additional headers or status information into the response payload.
11185
- - |-
11186
- ## IMPORTANT NOTES:
11187
- - This hook runs after all business logic but before the response is finalized and sent.
11188
- - Modifications here directly affect what the client ultimately receives.
11189
- - Errors thrown in this hook may cause the RESTlet to fail or return an error response.
11190
- - Use this hook to enforce response-level policies, compliance, or data governance rules.
11191
- - Avoid introducing side effects that could alter the idempotency or consistency of the response.
11192
- - Testing this hook thoroughly is critical to ensure it does not unintentionally break client integrations.
11193
- - |-
11194
- ## DEPENDENCY CHAIN:
11195
- - Triggered after the main RESTlet processing logic completes and the response object is prepared.
11196
- - Precedes the actual sending of the HTTP response to the client.
11197
- description: Custom hook functions executed at defined points in the RESTlet export lifecycle.
11198
- x-celigo-ai-guidance:
11199
- - |-
11200
- hooks:
11201
- > An array of hook definitions that specify custom functions to be executed at
11202
- various points during the lifecycle of the RESTlet script in NetSuite.
11203
- These hooks enable developers to inject additional logic before or after
11204
- standard processing events,
11205
- allowing for extensive customization and extension of the RESTlet's behavior to
11206
- meet specific business requirements.
11207
- - |-
11208
- ## FIELD BEHAVIOR:
11209
- - Defines one or more hooks that trigger custom code execution at designated lifecycle events.
11210
- - Hooks can be configured to run at standard lifecycle events such as beforeLoad, beforeSubmit, afterSubmit, or at custom-defined events tailored to specific needs.
11211
- - Each hook entry typically includes the event name, the callback function to execute, and optional parameters or context information.
11212
- - Supports both synchronous and asynchronous execution modes depending on the hook type and implementation context.
11213
- - Hooks execute in the order they are defined, allowing for controlled sequencing of custom logic.
11214
- - Hooks can modify input data, perform validations, log information, or alter output responses as needed.
11215
- - |-
11216
- ## IMPLEMENTATION GUIDANCE:
11217
- - Ensure that each hook function is properly defined, accessible, and tested within the RESTlet script context to avoid runtime failures.
11218
- - Validate hook event names against the list of supported lifecycle events to prevent misconfiguration and errors.
11219
- - Use hooks to encapsulate reusable business logic, enforce data integrity, or integrate with external systems and services.
11220
- - Implement robust error handling within hook functions to prevent exceptions from disrupting the main RESTlet processing flow.
11221
- - Document each hook's purpose, expected inputs, outputs, and side effects clearly to facilitate maintainability and future enhancements.
11222
- - Consider performance implications of hooks, especially those performing asynchronous operations or external calls, to maintain RESTlet responsiveness.
11223
- - When multiple hooks are defined for the same event, design them to avoid conflicts and ensure predictable outcomes.
11224
- - |-
11225
- ## EXAMPLES:
11226
- - Defining a hook to validate and sanitize input data before processing a RESTlet request.
11227
- - Adding a hook to log detailed request and response information after the RESTlet completes execution for auditing purposes.
11228
- - Using a hook to modify or enrich the response payload dynamically before it is returned to the client application.
11229
- - Implementing a hook to trigger notifications or update related records asynchronously after data submission.
11230
- - Creating a custom hook event to perform additional security checks beyond standard validation.
11231
- - |-
11232
- ## IMPORTANT NOTES:
11233
- - Improper use or misconfiguration of hooks can lead to unexpected behavior, performance degradation, or runtime errors.
10744
+ Use it to enrich or filter records with SuiteScript searches and record loads
10745
+ before they leave NetSuite (no extra API round-trips). The script must be
10746
+ written for the step's SuiteScript version (1.0 vs 2.x are not interchangeable);
10747
+ the SuiteScript 1.0 real-time variant receives a single record object rather
10748
+ than an array.
10749
+ description: |-
10750
+ SuiteScript hooks for the export. Only `preSend` exists on exports; imports carry
10751
+ the pre map, post map, and post submit hooks.
11234
10752
  cLocked:
11235
10753
  type: object
11236
10754
  description: Lock state that prevents modification of the configuration when set.
@@ -11239,38 +10757,10 @@ components:
11239
10757
  from NetSuite, along with the saved search, criteria, and columns it executes with.
11240
10758
  x-celigo-ai-guidance:
11241
10759
  - |-
11242
- restlet:
11243
- The identifier or URL of the NetSuite Restlet script to be invoked for
11244
- performing custom server-side logic or data processing within the NetSuite
11245
- environment.
11246
- This property specifies which Restlet endpoint the integration or application
11247
- should call to execute specific business logic,
11248
- automate workflows, or retrieve and manipulate data dynamically.
11249
- It can be represented as an internal script ID, a relative URL path,
11250
- or a full external URL depending on the integration scenario and access method.
11251
- - |-
11252
- ## FIELD BEHAVIOR:
11253
- - Defines the specific target Restlet script or endpoint for API calls within the NetSuite environment.
11254
- - Routes requests to custom server-side scripts developed using NetSuite's SuiteScript framework.
11255
- - Enables execution of tailored business processes, data validations, transformations, or integrations.
11256
- - Supports various HTTP methods such as GET, POST, PUT, and DELETE depending on the Restlet's implementation.
11257
- - Can be specified as a script ID, a relative URL path, or a fully qualified URL based on deployment and access context.
11258
- - Acts as the primary entry point for invoking custom logic that extends or complements standard NetSuite functionality.
11259
- - |-
11260
- ## IMPLEMENTATION GUIDANCE:
11261
- - Confirm that the Restlet script is properly deployed, enabled, and accessible within the target NetSuite account.
11262
- - Use the internal script ID format (e.g., "customscript_my_restlet") when calling via SuiteScript or internal APIs.
11263
- - Use the relative URL path (e.g., "/app/site/hosting/restlet.nl?script=123&deploy=1") or full URL for external integrations or REST clients.
11264
- - Verify that the Restlet supports the required HTTP methods and handles input/output data formats correctly (JSON, XML, etc.).
11265
- - Secure the Restlet endpoint by implementing authentication mechanisms such as OAuth 2.0, token-based authentication, or NetSuite session credentials.
11266
- - Implement robust error handling and retry logic to manage scenarios where the Restlet is unavailable or returns errors.
11267
- - Test the Restlet thoroughly in a sandbox environment before deploying to production to ensure expected behavior and security compliance.
11268
- - |-
11269
- ## EXAMPLES:
11270
- - "customscript_my_restlet" (internal script ID used in SuiteScript calls)
11271
- - "/app/site/hosting/restlet.nl?script=123&deploy=1" (relative URL for REST calls within NetSuite)
11272
- - "https://rest.netsuite.com/app/site/hosting/restlet.nl?script=456&deploy=2" (full external URL for third-party integrations)
11273
- - "customscript_sales_order_processor" (a Rest
10760
+ Two shapes: a saved-search export (`searchId` set; `criteria` optionally narrows it;
10761
+ `columns` omitted to return the search's own columns) or an ad-hoc search
10762
+ (`searchId: "-1"` or omitted, `recordType` + `criteria` + `columns` supplied, and
10763
+ `netsuite.skipGrouping: true` — without it the run fails with `[search_not_sorted]`).
11274
10764
  distributed:
11275
10765
  type: object
11276
10766
  properties: