0

We were using a sharepoint 2019 list as logging list and we moved that to SQL server. Then using BCS we are only reading the data from SQL and displaying in sharepoint using External Content Type and External list.

My question is: how can I trigger a workflow or external event receiver when the system/application creates/logs an entry in the database? We use the external list to view the data only, we don't create or update items residing in the external list. How can I notify the user when there is a change in the SQL database (table) which is used in the BCS to view the data only.

1 Answer 1

0

I would recommend configuring database mail for the SQL server and then creating a SQL trigger for types of database events the user is interested in (insert, update etc). Your SQL trigger can utilise the database mail feature to email the user and let them know that there has been a change.

4
  • I tried sending an email via sql server mail, but it does not arrive and the second problem is that how can I add dynamic data in the fields: To, subject and body? Jan 23, 2023 at 15:19
  • You'll need to troubleshoot your configuration of the database mail and ensure emails aren't in the user's junk mail folder etc. You can set the to, subject etc in your database trigger: stackoverflow.com/questions/10755469/… Jan 23, 2023 at 15:23
  • I am using a fake smtp server for testing purposes. It works fine from sharepoint itself, but not from SQL mail configuration Jan 23, 2023 at 15:30
  • As mentioned above, you'll need to troubleshoot your database mail problem. This forum is for SharePoint, so it isn't the best place for SQL server/mail server problems. Jan 23, 2023 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.