Hi, extract files in archive to site/mods/majic.
Please test it in Your test enviroment first!
Archive contains two files:
cntlastname.mod - contains trigger that fires spel code when group last_name is changed
MODIFY cnt {
PRE_VALIDATE zvalidate_last_name () 45821 FILTER( type == 2308 && last_name{});
};
cntlastname.spl - contans spel code that checks if group last_name is unique
cnt::zvalidate_last_name(...)
{
string wc;
wc = format("type = 2308 AND last_name = '%s'", last_name);
send_wait(0, top_object(), "call_attr", "cnt", "sync_fetch", "MLIST_STATIC", wc, -1,0);
if (msg[1]>0)
set_error(1);
set_return_data("Can not insert group with duplicate name");
return;
}