Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active June 6, 2017 21:27
Show Gist options
  • Save stevewithington/6346911 to your computer and use it in GitHub Desktop.
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.
<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>
@russianlife
Copy link

russianlife commented Jun 6, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment