REST multiple insertion

I need to insert multiple rows into the OpportunityLineItem table in one POST request https: //*.salesforce.com/services/data/v20.0/sobjects/OpportunityLineItem

A single insert works fine for me: {"OpportunityId": "xxx", "Quantity": 1, "UnitPrice": 100, "PricebookEntryId": "xxx"}

But it fails when I try to POST a few records {"records": [{"OpportunityId": "xxx", "Quantity": 1, "UnitPrice": 100, "PricebookEntryId": "xxx"}, {" OpportunityId ":" xxx "," Quantity ": 4," UnitPrice ": 110," PricebookEntryId ":" xxx "}]}

+5
source share
2 answers

You cannot insert multiple lines in one call to the rest of the api, you need to use the api array.

+4
source

Summer '15 release allows you to combine various operations, such as inserting, updating, deleting, accessing various types of objects in one request. Release Note

I found it in a recurring question .

0
source

All Articles