Thanks David.  Here is what I ended up with after some debugging and modifications:


<cffunction name="DisplayUserRoles" returntype="string" output="no">
   <cfargument name="userID" type="numeric" required="yes">    
   <cfset var rolesQuery = "">
  
   <cfquery name="rolesQuery" datasource="#Application.dbDSN#" 
      username="#Application.dbUsername#" password="#Application.dbPassword#">
         SELECT   pr.RoleName
         FROM     PlumRole pr, PlumUserRole pur
         WHERE    pr.RoleCode = pur.RoleCode
                  AND pur.UserID = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#Arguments.userID#">
         ORDER BY pr.RoleName ASC
   </cfquery>
 
   <cfreturn ValueList(rolesQuery.RoleName, "<br>")>
</cffunction>



AND


<cf_DisplayExpressionInList ...>
   <cf_DisplayColumnInList column="UserID" ...>
   
   #Caller.DisplayUserRoles(PlumUser_UserID)#
</cf_DisplayExpressionInList>


Thanks Again! I didn't think of using a function. It is working like a charm now.

Jim


From: "David Churvis" <[EMAIL PROTECTED]>
Sent: Thursday, April 14, 2005 10:38 AM
To: [email protected]
Subject: Re: [plum] Roles on User List


Jim,
 
Here's something that might work well for you.  In the top of the list page create a function that looks like this:
 
<cffunction name="DisplayUserRoles" returntype="string" output="no">
    <cfargument name="userID" type="numeric" required="yes">
   
    <cfset var rolesQuery = "">
   
    <cfquery name="rolesQuery">
    SELECT pr.RoleName
    FROM PlumRole pr INNER JOIN PlumUserRole pur
    WHERE
        pr.RoleCode = pur.RoleCode AND
        pur.UserID = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#Arguments.userID#">
    </cfquery>
   
    <cfreturn ValueList(rolesQuery.RoleName)>
</cffunction>
 
Then, make your CF_DisplayExpressionInList look like this:
 
<cf_DisplayExpressionInList ...>
    <cf_DisplayColumnInList column="UserID" ...>
   
    #Caller.DisplayUserRoles(PlumUser_UserID)#
</cf_DisplayExpressionInList>
 
This should solve your problem.  Let us know how it works for you :)
 
Dave
----- Original Message -----
From: Jim Canup
To: [email protected]
Sent: Wednesday, April 13, 2005 2:17 PM
Subject: [plum] Roles on User List

I am desperately trying to hand-code a column to the
Plum User List that will display a comma delimited
list of the User's Roles. I am having no Luck at all!
 
Anyone want to offer a hand???
 
Jim Canup
Application Security Engineer
Digital Insight
Two Midtown Plaza
1349 W Peachtree St
Suite 1300
Atlanta, GA 30309
[EMAIL PROTECTED]
tel:
fax:
mobile:
770-349-1267
678-969-7025
404-229-6562
Add me to your address book... Want a signature like this?

Reply via email to