Skip to main content
Version: 5.7.0

SysUpdateEntityFields

tip

This method is not sharding safe - and thus is not recommended for custom entities that you may want to shard for greater performance and scalability in the future. Consider using SysUpdateEntityFieldsSharded() version of this method instead.

Used to update only a specific set of fields with the custom data section of the custom entity object. Ignores ownership/ACL checks.

The outer "data" portion of the field name is implied, and should not be included.

fieldsJson example:

{
"age": 30,
"homeAddress": {
"street": Breakwater Street",
"number": "11",
"city": "Souris",
"state": "PEI",
"country": "CA",
"phone": "555-555-1234"
},
"workAddress.phone": "555-555-5555"
}

For the above example:

  • the data.age field will be set to 30
  • the data.homeAddress field will be set to the full JSON address provided
  • just the phone sub-field of the data.workAddress object will be set to "555-555-5555"
ServiceOperation
customEntitySYS_UPDATE_ENTITY_FIELDS

Method Parameters

ParameterDescription
entityTypeThe type of custom entity being updated.
entityIdThe id of custom entity being updated.
versionVersion of the custom entity being updated.
fieldsJsonSpecific fields, as JSON, to set within entity's custom data.

Usage

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"status": 200,
"data": {
"entityId": "1497cc7e-66cb-4682-xxxx-c755523369a8",
"version": 2,
"acl": {
"other": 1
},
"ownerId": null,
"expiresAt": null,
"timeToLive": null,
"createdAt": 1573540122600,
"updatedAt": 1573540445332
}
}