ebs.massUpdate
Updates attribute values for multiple records. You can update records from different entities and you can update multiple attributes within the same record.
Syntax
Copy
ebs.massUpdateEbs(modifyRequest: IModifyRequestCollection, callback: any, errorCallback: any): void
Where IModifyRequestCollection has the following syntax:
Copy
[
{
Id: "<<i>record_id</i>>",
EntityName: "<<i>parent_entity</i>>",
Values: [{
Attribute: "<<i>attribute_name</i>>",
Value: "<<i>attribute_value</i>>"
}]
},
{
Id: "<<i>record_id</i>>",
EntityName: "<<i>parent_entity</i>>",
Values: [{
Attribute: "<<i>attribute_name</i>>",
Value: "<<i>attribute_value</i>>"
}]
}
]
| Parameter | Description |
|---|---|
record_id
|
Unique identifier of the record you wish to update. |
parent_entity
|
Name of the parent entity of the record you wish to update. |
attribute_name
|
Name of the record's attribute you wish to update. |
attribute_value
|
The value you wish to allocate the record's attribute. |
Response
void
Examples
In this example, as a result of an internal reorganization, the training division is moved from the Training and Documentation department to the Community department. Therefore, the department names are renamed accordingly:
- The ID of the Training and Documentation department is 85cb2e53-f0ae-4f66-85d4-6029769c7881.
- The Training and Documentation department is renamed to Documentation.
- The ID of the Community department is af62cae0-2b0a-4344-8534-a72c429a5c30.
- The Community department is renamed to Community and Learning.
- The update request is successful (IsSuccess: "true").
- 2 records are updated by the request (Records updated: "2").
Request
Copy
ebs.massUpdateEbs(
{Requests: [
{
Id: "85cb2e53-f0ae-4f66-85d4-6029769c7881",
EntityName: "Department",
Values: [
{
Attribute: "name",
Value: "Documentation"
}
]
},
{
Id: "af62cae0-2b0a-4344-8534-a72c429a5c30",
EntityName: "Department",
Values: [
{
Attribute: "name",
Value: "Community and Learning"
}
]
}
]}, function(e){
console.log(e.IsSuccess);
console.log(e.Message);
}
);