change the state and active in contract on condition

mregragui_ext
Tera Contributor

hello,

i want to change the state to expire and active to false in conctracts table whenever a contract END and renewel end is in the past.

Thanks for help!

5 REPLIES 5

Hi @mregragui_ext ,

Insted of setvalue use below script

(function executeRule(current, previous /*null when async*/) {

current.state='expirebackedname';
current.active='false';
current.setWorkflow(false);
current.update();
    }
})(current, previous);