How to update a collection when another collection changes?

I’m doing a exercise to learn about squidex and I’m facing this issue:

  • I have two collections: Accounts (bank accounts) and Operations (deposits and withdrawals)
  • My Accounts schema has a Balance field
  • Everytime I Insert,Update or Delete an Operation, Balance should reflect this change

I thought it would be possible to create scripts in Operations and recalculate or adjust the Account balance, but, AFIK, context has only the current data being manipulated =\

Yes, the scripts are limited to some use cases. As Squidex is not written in javascript, it is an independent, isolated, sandboxed scripting framework.

Your only option for now is to create a webhook and use the rules. Or to just make two API calls from your client.