Editar

Compartilhar via


CreateMultiple operation

Creates a set of records. The supplied record object is overwritten with the version that is created by the page.

Method signature

void CreateMultiple(ref Entity[] entity)

Parameters

Parameter Description
entity[] Type: An array of Entities

An array of a specific object type that represents the page.

Results

Result name Description
entity[] Type: An array of Entities

An array of a specific object type that represents the page. Contains the latest values that are present on the page after the records have been inserted into the table.

Faults

SOAP fault message Description
The [record name] already exists. Identification fields and values: [field]=[value] Indicates that the insertion of at least one of the records would violate key constraints.

Other faults are possible if they're generated by the AL code.

The CreateMultiple operation is executed as a single transaction unless the AL code explicitly commits the transaction. Either all or none of the records are inserted unless the application code doesn't explicitly call COMMIT.

Usage example

Customer[] custArray = new Customer[3];  
for (int i = 0; i < custArray.Length; i++)  
{  
  custArray[i] = new Customer();  
  custArray[i].Name = "Customer Name " + i.ToString();  
}  
service.CreateMultiple(ref custArray);  

See also

Basic Page Operations