Update / Delete Functions

The following api. functions are available:

Name and Link to API DocCode Example
add
addOrUpdate
createNewRevision
delete
api.delete("PX", ["id": existingRecord, "name": "ActivePrice"])
update
updateCalculableObjectHeader


Order

The order of api.delete/update/add operations is NOT defined by the order in which they are called in the code. The only sequence that you can rely on is the sequence across elements. So if you need to define a sequence, you need to place the operations into separate elements.

Within an element, the statements are re-ordered by the underlying stack.

Significant Fields

As a parameter of the delete/add/addOrUpdate functions you need to provide key-value pairs representing significant fields of the object you want to manipulate. This is to identify the object unambiguously. Generally, these functions accept calls with “id”, as this is also always unique.

The following rules summarize whether an object can be identified with or without the id value:

  • If the type code is “PX” or “CX” (= virtual type codes), you need to provide “name” to be able to resolve the real type (e.g. PX10). 
    • In case of PX/CX, it takes the defined business keys into account (if defined).
  • In all other cases, the objects are looked up by built-in significant fields (i.e. built-in business key):
    • P = sku, C = customerId
    • PX/CX have none
    • PGI: sku & priceGridId
    • PLI: sku & pricelistId
    • MLTV: lookupTable & name

Found an issue in documentation? Write to us.