I am trying to set relationships in an API function an I am getting the following error:
“Unable to perform ‘ADD_RELATION’ operation due to argument incompatibility. The operation references a result from another ‘UPSERT_BULK’ operation. The specified result cannot be obtained from this operation (objectId).”
The function I am trying to create takes a list of sales transactions and saves them into 3 different tables. These tables will need relationships to link to each other.
I have included a screenshot of my code blocks below, the problem area is highlighted with the red square.
I initially tried using a “bulk upsert operation” on the line_item table but the “create operation” inside a for loop is the option pictured. Both options produce the same error.
If I remove the relations blocks from the function the records are saved to the database successfully.
The list of objects I am splitting looks like this:
{
“selling_price”: 404,
“url”: “https://www.ealot.com/x/PLID41294934”,
“quantity”: 2,
“sale_status”: “Shipped to Customer”,
“url_mobi”: “https://www.ealot.com/x/PLID41294934”,
“offer_id”: 53170421,
“product_title”: “ET-Blu Mix 2 Button Remote - Blue”,
“order_item_id”: 126169025,
“order_date”: “2021-04-05 18:00:00”,
“tsin”: 44054365,
“sku”: “A0807x001”,
“order_id”: 86101273,
“dc”: “JHB”,
“customer”: “Lawrence Dipudi”
}
Any assistance would be most welcome.