Last active
June 6, 2017 21:27
-
-
Save stevewithington/6346911 to your computer and use it in GitHub Desktop.
Mura CMS : How to obtain a recordset and iterator of members of a specific group.
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
<cfscript> | |
groupBean = $.getBean('user').loadBy( | |
groupname='Admin' | |
, siteid=$.event('siteid') | |
); | |
// recordset | |
rsGroupMembers = groupBean.getMembersQuery(); | |
// iterator | |
itGroupMembers = groupBean.getMembersIterator(); | |
</cfscript> | |
<!--- Can you write the code to output the members? ---> | |
<cfif itGroupMembers.hasNext()> | |
<cfloop condition="itGroupMembers.hasNext()"> | |
<cfset member = itGroupMembers.next()> | |
<cfdump var="#member.getAllValues()#"> | |
</cfloop> | |
<cfelse> | |
<p>No members exist.</p> | |
</cfif> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steve: Trying to get this to work to pull a list of members that I can then loop through to send email (manual notification of group of new blog post). But getting a 500 error. Is there something elemental I am not understanding? PR
500 Error
The getMembersQuery method was not found.
Either there are no methods with the specified method name and argument types or the getMembersQuery method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
Column: 0
ID: CF_STRUCTBEAN
Line: 7