How to Bulk Update Records
This guide shows how to bulk update records efficiently in Sanka using the UI and how it works behind the scenes.
When to use bulk update
- Update many records at once (e.g., change status, assign owner, correct dates)
 - Fix data at scale while keeping audit logs and associations consistent
 - Offload heavy updates to background jobs when selections are large
 
Update from the UI
- Go to the list page for the object (Contacts, Companies, Items, Orders, Invoices, etc.)
 - Filter and select the records to update
 - Choose Bulk Action → Update Value
 - Pick the fields to change, enter new values, and confirm
Sanka automatically decides whether to update inline or in the background based on selection size.

 
What happens under the hood
Sanka centralizes bulk updates in a reusable function so that both the UI and background workers behave the same.
- Core function: data/object.py:51 _apply_update_value_bulk(...)
- Validates and maps fields per object type (e.g., first_name → name for Contacts)
- Parses date and datetime fields with timezone awareness
- Saves with update_fields to keep logs and speed up writes
- Updates customer associations for Invoices, Orders, Estimates, and Items
- Threshold-based background jobs: data/object.py:1038
- If selected count > BULK_UPDATE_ASYNC_THRESHOLD, we enqueue a Hatchet job
- Payload type: utils.scheduled_tasks bulk update workflow
- UI shows “bulk update job started” and you can keep working
- Signals and logs
- Invoice-specific bulk update signal: data/invoice/signal/invoice_trigger_workflow.py:293
- Generic post-bulk-update signal: data/signals.py:188
- Writes history for audit and may trigger related recalculations
Example: change due date for multiple invoices
Steps from the UI:
1. Navigate to Invoices list and filter the target invoices
1. Select all → Bulk Action → Update Value
1. Set Due date to your new date
1. Confirm
Behind the scenes:
- The view collects selected IDs and chosen fields
- For large batches, Sanka enqueues a background task automatically
- _apply_update_value_bulk converts the input to proper Python types and saves only changed fields
- Invoice totals and associations are refreshed as needed
Tips
- Use filters to narrow your selection before bulk update
 - For dates, you can enter localized formats (e.g., 
2025年11月01日) — Sanka parses and normalizes - If you need to change customer on Orders, associations are kept in sync
 
Troubleshooting
- If a field isn’t changing, confirm it’s editable for the selected object type
 - Very large updates might run in the background; check task history if you don’t see immediate changes
 - For custom objects and properties, ensure the property types are one of the updatable types