SDU
Personal tools

Require Assignee to be a Member of the selected Group

From SDU

Jump to: navigation, search

I came across this customization to require that the Assignee be a member of the selected Group on a ticket. It works fine in 12.5 but am pretty sure it was originally written for 11.2 so should work in earlier versions:

MOD:


// verify Assignee is a member of the selected Group

MODIFY cr PRE_VALIDATE zcr_assignee_validate(assignee) 140 FILTER ( EVENT ("INSERT UPDATE") );

SPL:

// verify Assignee is a member of the selected Group

cr::zcr_assignee_validate(...)

{

string where_clause, zmsg;

if (!is_null(assignee) && !is_null(group))

{

where_clause = format("group = U'%s' and member = U'%s'", group, assignee);

send_wait(0, top_object(), "call_attr", "grpmem", "sync_fetch", "RLIST_STATIC",where_clause, -1, 0);

if ( msg[1] == 0 )

{

zmsg=format(" Please either change the Group or select an Assignee who is a member of Group %s", group.last_name);

set_error(1);

set_return_data(zmsg);

return;

}

}

}



I tested this out in r12.0 and it worked perfectly! I have been trying to develop this exact thing for a while now. Thanks for the post!!! - Giuseppe

This page was last modified 05:09, 10 December 2010.  This page has been accessed 1,603 times.  Content is available under Attribution-Noncommercial-Share Alike 3.0 UnportedDisclaimers