Database Triggers
An overview of database triggers that automate various report, routine, and notification processes in MinistryPlatform, like managing group enrollments, event cancellations, and record syncs.
The following database triggers run on every MinistryPlatform system. Custom triggers may be on specific systems.
- Add Registrants to Groups
- This trigger fires if you add a new invoice detail record associated with a product option price with a value in the Add to Group field. It enrolls the registrant in the appropriate group based on the selection made on the registration form.
- Add Responding Participant to Event or Group
- When you update a row on the responses table and the Response Result field is set to Placed, this trigger adds the participant making the response to the corresponding group or event listed on the opportunity record.
- Canceling an Event
- When someone with event edit rights changes a record and sets Cancelled to Yes, a trigger fires to:
- Add ***Cancelled*** to the event title,
- Delete an existing rooms, equipment or service records assigned to that event, and
- Turn off registrations when appropriate.
If the event is un-cancelled, it automatically un-cancels any services, rooms, and equipment attached to the event.
If the event, services, rooms, and equipment record has the Approved field already set to Yes, then those items are not resubmitted for approval. If the Approved field is not set, then those items are submitted for approval.If you want those events resubmitted for approval, Professional Services or someone on your staff with access to SQL can change the trigger to update the Approved field.
The audit log records changes to the Event Title and Registration Active fields for the event and Cancelled fields for supporting items (room, equipment, and services).
- Canceling a Room Reservation
- When you edit a room reservation record and set the Cancelled field to Yes, a trigger fires to add ***Cancelled*** to the notes for that item. The item no longer displays on double-booked views and reports. The item may display in the available room views and reports in that time slot if it's not used for another event during that time.
- Canceling an Equipment Reservation
- When you edit an equipment reservation record and set the Cancelled field to Yes, a trigger fires to add ***Cancelled*** to the notes for that item. The item no longer displays on double-booked views and reports. The item may display in the available room views and reports in that time slot if it's not used for another event during that time.
- Canceling a Service Request
- When you edit a room reservation record and set the Cancelled field to Yes, a trigger fires to add ***Cancelled*** to the notes for that item.
- Email Proxy Form
- This trigger exists on the dp_Communication_Messages table ( page) and replaces the From email address on emails sent from MinistryPlatform when that email address is not part of the church domain. Use this to avoid spam filters in cases when volunteers can send emails from MinistryPlatform using their personal emails. See Configure A Proxy Email.
- End Date Group Participants
- When you update a row on the Groups table and update the group's End Date field, this trigger updates the End Date field for every group participant still actively involved in that group. Note: This trigger only works the first time you edit the end date.
- Insert Reciprocal Relationship
- When you insert a row into the Contact Relationships table, this trigger inserts a second row that creates the reciprocal relationship for the related contact. For example, if you add a record listing one record as the child of another record, then a row is inserted listing the second record as the parent of the first record.
- Room Reservation, Equipment Reservation, & Service Request Auto Approve
- When you insert or update an event record, this trigger fires to ensure that the following fields are synchronized with the event's Approved field for any reservation where the item in question is set to Auto Approved.
- The event room Approved field
- The event equipment Approved field
- The event series Approved field
Note: This depends on your room approval process setup. - Synchronize Donor Record
- When you insert a row or update the Donors table, this trigger updates the contact Donor Record field on the Contacts page.
- Synchronize Participant Record
- When you insert a row or update the Participants table, this trigger updates the contact Participant Record field on the Contacts page.
- Synchronize User Record
- When you insert a row or update the Users table, this trigger updates the contact User Account field on the Contacts page.
- Update Reciprocal Relationship
- When you update a row on the Contact Relationships table, this trigger updates the reciprocal relationship. For example, if a contact is listed as married to another contact and you update the row to reflect a divorce, this trigger updates the reciprocal record.