- My View
We are currently using Istanbul. We have a custom training app that has a table for course_instance and a table for course_attendees. I want the survey to be sent when the state of both records is set to "complete". Since the trigger survey option is based on 1 table and I need to be able to pull information from both tables, I assumed I could create a db view between the 2 tables (successfully) and then use that new db view as the target table in the survey trigger. I can't get a new survey instance to populate whenever I change the states.
Unfortunately, you can't create a Trigger condition for a Database View. When you create a Trigger Condition, the system automatically creates a Business Rule for the Table mentioned in Trigger Condition. Since there is no concept of business rule for Database Views, the trigger condition on Database views doesn't work.
For your use case, I can think of the following options.
1. Create an update business rule on both tables. When the business rules get executed, it would check both the tables and send a Public Survey URL in the Email Notification.
2. Create an update business rule on both tables. When the business rules get executed, it would check both the tables and use the below script to create a survey instance.
Hope this helps. Mark the answer as correct/helpful based on impact.