Scripting on Contacts and Organizations
Contact and Organization records support Event Handlers — scripts that fire automatically when a record is created or updated.
Event Handlers on Contacts
Configure via Integration → Event Handlers. Select “Contact” as the entity and the appropriate lifecycle event.
| Event | When It Fires |
|---|---|
onCreateContact |
A new Contact record is created in memory (before first save) |
postLoadContact |
A Contact is loaded from the database |
postInsertContact |
A new Contact is first saved to the database |
postUpdateContact |
An existing Contact is updated |
Common uses:
- Sync the contact to an external CRM when created or updated
- Enforce data standards: normalise phone number format, capitalise names
- Assign a segment based on contact attributes
- Create a default opportunity record for new major gift prospects
Event Handlers on Organizations
Same lifecycle events, with “Organization” as the entity type.
Common uses:
- Sync employer data to an external HR or payroll system
- Create default employee relationship structures for new employers
- Update a federation membership record when an organization is modified
Script Context
| Variable | Contents |
|---|---|
instance |
The Contact or Organization record being created/updated |
account |
The DonorPoint account |
user |
The staff member performing the action (if applicable) |
→ Full context reference: Scripting Contexts