I'm trying to remove some documents out of my batch using the method DeleteDocument of IBatch.
I wrote a script to do that but everytime I'm getting a error with the message "It's not possible to modify the batch structure in this script" (the real message is in portuguese-br: Não é possível modificar a estrutura do lote neste script).
I tried the same script in different events handler and stages.
Does anybody know where it's possible to change the batch structure?
Here is the script