Action References
UpdateCrudAction
UpdateCrudAction
Purpose Updates related or child records based on a query. Used for propagating state changes or syncing dependent records after the main record is updated.
When to use it
- After an update (
afterMainUpdateOperation) - After specific validations when business state must cascade
Key fields
| Field | Type | Description |
|---|---|---|
childObject | DataObjectName | Target object to update. Can be a local data object (same service) or a remote data object (different service). For remote objects, the action automatically routes to the target service's M2M edge function (m2mUpdate{ObjectName}ByQuery) using secure machine-to-machine authentication. The tenant codename is automatically included in request headers for multi-tenant scenarios. |
whereClause | MScript | Query that selects which records to update. |
dataClause | [ApiAggregateData] | Property–value assignments applied to matched records. |
Inter-Service Support
UpdateCrudAction supports both local and remote data objects:
- Local objects: The action calls the service's dbLayer utility function directly (
update{ObjectName}ByQuery) - Remote objects: The action automatically routes to the target service's M2M edge function (
m2mUpdate{ObjectName}ByQuery) using secure machine-to-machine authentication. This enables seamless inter-service CRUD operations without manual API calls.
For multi-tenant services, the tenant codename is automatically propagated to the remote service via the mbx-{tenantName}-codename header.
Example
{
"id": "a120-update-tasks",
"name": "closeRelatedTasks",
"childObject": "task",
"whereClause": "{ projectId: this.projectId, status: 'open' }",
"dataClause": [
{ "dataProperty": "status", "dataValue": "'closed'" },
{ "dataProperty": "closedAt", "dataValue": "NOW()" }
]
}
Was this page helpful?
Built with Documentation.AI
Last updated Jan 3, 2026