Hi friends, i resolve this using this:
on the .mod file:
OBJECT zdemand_aplicativos_list {
TRIGGERS {
PRE_VALIDATE verify_demand_app_list() 23332
FILTER(
EVENT("INSERT UPDATE")
);
};
};
on the .spl file:
zdemand_aplicativos_list::verify_demand_app_list(...)
{
uuid who;
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
who=msg[0];
send_wait(0, top_object(), "call_attr", "api", "get_list", "zdemand_aplicativos_list", who, format("zdemand_id = %s AND zdemand_aplicativo_id = %s AND delete_flag = 0", zdemand_id,zdemand_aplicativo_id), -1);
if (msg_error()) {
printf("Error %s",msg[0]);
}
else
{
int count;
object obList;
count = msg[1];
obList = msg[0];
printf(msg[1]);
if(count > 0){
logf(SIGNIFICANT, "Ya existe el aplicativo en la lista, aparece un total de: %s veces.", count);
set_error(1);
set_return_data("Error: Ya este elemento existe en la lista");
return;
}
}
}
Using this guide: get_list
Thanks!!