Any way to write to DB from a function?

I agree with others that updating via service method calls is a better way.
But, your code updates only one field (NotifyFlag), so I think that the direct update is quite safe here.

  1. DB Access from Code option should be Read Write

  2. Table reference should be marked as updatable

  3. To save changes in the code you need to use Db.SaveChanges() method.
    image

4 Likes