Sankhya icon

Sankhya

Integração completa com o ERP Sankhya — REST v1/v2 e Gateway

Actions137

Entidade — Salvar (DatasetSP.save) → Executar

AI-generated

Summary

Executes the DatasetSP.save service to insert or update records in a Sankhya dataset.

Inputs

  • rootEntity (required) — The name of the dataset/entity (e.g., 'Produto').
  • saveFields (required) — A JSON array of field names in the dataset (e.g., ['NOMEPARC', 'ATIVO']).
  • saveRecords (required) — A JSON array of records to save. Each record is an object with a 'values' property mapping field names to values. If a record includes a 'pk' property, it performs an update; otherwise, it creates a new record. Values are indexed by the order defined in 'saveFields'.

Output shape

The API response body, typically indicating success or failure.

Returns Sankhya's business error codes (CORE_E) or technical errors (GTW codes) as JSON objects. The exact return shape depends on the dataset's response schema.

Examples

Example 1: Create a new product

rootEntity='Produto', saveFields=['CODPROD','NOMEPARC','ATIVO'], saveRecords=[{'values':{'1':'1001','2':'Test Product','3':'S'}}]

Example 2: Update an existing product

rootEntity='Produto', saveFields=['CODPROD','NOMEPARC','ATIVO'], saveRecords=[{'pk':{'1':'1001'},'values':{'2':'Updated Product Name'}}]

Links

Discussion