lookupUsers

Lasă un comentariu

5 Ianuarie 2015 de liviustoica55


void lookupUsers(FormControl control)

{

Query query = new Query();

QueryBuildDataSource qbdsUser;

QueryBuildDataSource qbdsAssignee;

QueryBuildDataSource qbdsUserInfo;

SysTableLookup sysTableLookup;

sysTableLookup = SysTableLookup::newParameters(tableNum(SysUserInfo), control);

sysTableLookup.addLookupfield(fieldNum(SysUserInfo, Id), true);

qbdsUser = query.addDataSource(tableNum(SysUserInfo));

//query should include only enabled AX users.

qbdsUserInfo = qbdsUser.addDataSource(tableNum(UserInfo));

qbdsUserInfo.joinMode(JoinMode::ExistsJoin);

qbdsUserInfo.addLink(fieldNum(UserInfo, Id), fieldNum(SysUserInfo, Id));

qbdsUserInfo.addRange(fieldNum(UserInfo, Enable)).value(‘true’);

qbdsUserInfo.addRange(fieldNum(UserInfo, ExternalUser)).value(‘false’);

//query should not include users already added as queue members

qbdsAssignee = qbdsUser.addDataSource(tableNum(WorkflowWorkItemQueueAssignee));

qbdsAssignee.joinMode(JoinMode::NoExistsJoin);

qbdsAssignee.addLink(fieldNum(WorkflowWorkItemQueueAssignee, User), fieldNum(SysUserInfo, Id));

qbdsAssignee.addRange(fieldNum(WorkflowWorkItemQueueAssignee, WorkitemQueue)).value(queryValue(

workflowWorkItemQueue.RecId));

sysTableLookup.parmQuery(query);

sysTableLookup.performFormLookup();

}

Lasă un răspuns

Completează mai jos detaliile despre tine sau dă clic pe un icon pentru autentificare:

Logo WordPress.com

Comentezi folosind contul tău WordPress.com. Dezautentificare / Schimbă )

Poză Twitter

Comentezi folosind contul tău Twitter. Dezautentificare / Schimbă )

Fotografie Facebook

Comentezi folosind contul tău Facebook. Dezautentificare / Schimbă )

Fotografie Google+

Comentezi folosind contul tău Google+. Dezautentificare / Schimbă )

Conectare la %s

%d blogeri au apreciat asta: