Last active
January 7, 2016 17:34
-
-
Save pauldenato/bdb49e2967b7d29bcdbf to your computer and use it in GitHub Desktop.
Get Specific Groups Users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<cfscript> | |
$ = application.serviceFactory.getBean('$').init(session.siteid); | |
group=$.getBean( 'user' ).loadBy( groupname = '{your group name}', siteid='#session.siteID#' ); | |
groupID = group.getValue('userid'); | |
//Create a USER Feed Bean | |
userFeed=$.getBean('userFeed'); | |
userFeed.setSiteID('#session.siteid#'); | |
userFeed.setType(2) | |
//change to 1 for non system users | |
.setIsPublic(0); | |
//filter off of groupID | |
userFeed.setGroupID('#groupID#', false); | |
//advanced filter | |
/*userFeed.addParam( | |
field='tusers.lastname' | |
, relationship='AND' | |
, condition='EQUALS' | |
, criteria='Smith' | |
, dataType='varchar' | |
);*/ | |
//get the iterator from the feed | |
userIterator = userFeed.getIterator(); | |
</cfscript> | |
<cfset qryFindGroupsUsers = userIterator.getQuery() /> | |
<!--- HTML FORM Insert---> | |
<div class="control-group"> | |
<!---Sales Users---> | |
<div class="span6"> | |
<label class="control-label"> | |
<a rel="tooltip" href="##" onclick="return false;" title="">Sales Users<i class="icon-question-sign"></i></a> | |
</label> | |
<div class="controls"> | |
<select id="users" name="users" class="span12" message="The 'User' field is required" required="true"> | |
<option value="0">Select One</option> | |
<cfoutput query="qryFindGroupsUsers"> | |
<option value="#qryFindGroupsUsers.userid#">#qryFindGroupsUsers.lname#, #qryFindGroupsUsers.fname#</option> | |
</cfoutput> | |
</select> | |
<span class="label label-danger questionErrorList"></span> | |
</div> | |
</div> | |
</div> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment