I have not tested this code, but i think it should work. Code should work if you will use pre_validate trigger
not sure what is code in your enviroment, but for example i will use Reopen:
PRE_VALIDATE zreopen() 4009 FILTER( EVENT("UPDATE") && (status{->'REOPEN'} ));
chg::zreopen(...){
object objList, objectPointer;
string wc;
uuid who;
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
if (msg_error())
{
logf(ERROR, format("AHDConnect: Get co_group '%s'", msg[0]));
return (-1);
}
who=msg[0];
wc = format("chg = %d", id);
send_wait(0,top_object(),"call_attr","wf","sync_fetch","MLIST_STATIC", wc,-1,0);
objList = msg[0];
if (msg[1]>0)
{
send_wait(0, objList, "dob_by_index", "DEFAULT", 0, 0);
if (msg_error())
{
logf(ERROR, format("AHDConnect:dob_by_index '%s'", msg[0]));
return (-4);
}
else
{
objectPointer = msg[0];
send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, objectPointer.persistent_id, 0, "status", "tskstat:7105");
if (msg_error())
{
logf(ERROR, "Update object macro error: '%s'", msg[0]);
}
}
}
}