deluge script not working in "on add/success" but working fine in "on add/on load"

deluge script not working in "on add/success" but working fine in "on add/on load"

Hi,

I have a simple record-counter script that works in "on add/on load" but it doesnt work in "on add/on success"


this is the script:

Variables_de_Sistema  =  Variables_de_Sistema  [ID != 0];
input.Numero = (Variables_de_Sistema.Ordenes_Ultimo  +  1);
Variables_de_Sistema.Ordenes_Ultimo = (Variables_de_Sistema.Ordenes_Ultimo  +  1);


the script updates fine the input.Numero field in both cases, no problem there. The problem is that in "on add/on success" the variable "Variables_de_Sistema.Ordenes_Ultimo" does not get updated with +1. i.e. the third line of the script has no effect. the exact same script though works perfectly in "on add/on load"

the thing is I don need this on load but on success... therefore I am stuck here.

Cheers
Luis