Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

telerik -- supercharge your DNN websites
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  User Defined Ta...  Query Parameters to filter results based on a Custom Profile Field
Previous Previous
 
Next Next
New Post 6/16/2008 3:40 PM
Unresolved
User is offline Josh Wheeler
11 posts
10th Ranked


Query Parameters to filter results based on a Custom Profile Field 

I have the basic functionality enabled to only allow the user who created the row to see/edit the row.

I would like to extend this to include a Profile Property in the "WHERE" clause.

For instance: WHERE 'FieldValue'=$NameOfCurrentUser or 'FieldValue'=$AccountNumber or $IsAdministrator

Here's my working code:
    <xsl:variable name="NameOfCurrentUser" select="udt:Context/udt:UserName" /> 
    <xsl:variable name="IsAdministrator" select="udt:Context/udt:IsAdministratorRole='true'" />
    <xsl:variable name="currentData" select="udt:Data[*['FieldValue']=$NameOfCurrentUser or $IsAdministrator]" />

What I am looking for:
    <xsl:variable name="NameOfCurrentUser" select="udt:Context/udt:UserName" />
    <xsl:variable name="AccountNumber" select="udt:Context/udt:[Profile:AccountNumber]" />
    <xsl:variable name="IsAdministrator" select="udt:Context/udt:IsAdministratorRole='true'" />
    <xsl:variable name="currentData" select="udt:Data[*['FieldValue']=$NameOfCurrentUser or $IsAdministrator]" />

Reason: I need more than one DNN Account to be able to create rows, but allow all accounts with the same Custom AccountNumber to see rows for that AccountNumber.

Thanks!

 
New Post 6/16/2008 11:19 PM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: Query Parameters to filter results based on a Custom Profile Field 

You can help yourself.

Add a new column AccountNumber, datatype CalculatedColumn, and as expression  '[Profile:AccountNumber]'. 


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
New Post 6/17/2008 1:05 PM
User is offline Josh Wheeler
11 posts
10th Ranked


Re: Query Parameters to filter results based on a Custom Profile Field 

 Stefan Cullmann wrote

You can help yourself.

Add a new column AccountNumber, datatype CalculatedColumn, and as expression  '[Profile:AccountNumber]'. 

Okay, not sure I understand exactly what you are hinting at, but it seems to me that the calculated field's value is not accessible before the query runs. 
<xsl:variable name="AccountNumber" select="udt:AccountNumber" />

I need to look into the Custom Profile Property of the currently logged in user, similar to [User:UserName], get the value, assign it to a variable that I can use as a query parameter to limit/expand the number of results on.
<xsl:variable name="AccountNumber" select="udt:Context/udt:[Profile:AccountNumber]" />

So far, that does not seem possible at this level. The [Profile:<field>] functionality seems only to be available one level down from where I am.

Thanks!

 
New Post 6/18/2008 12:22 AM
User is offline Stefan Cullmann
1553 posts
5th Ranked








Re: Query Parameters to filter results based on a Custom Profile Field 

It is available, for sure. Look at the XML. Maybe you don't know the correct XPath statement to access it. 

Try for example (if the name of the calculated column is AccountNumber):
<xsl:variable name="AccountNumber" select="udt:Data[0]/udt:AccountNumber" />


Stefan Cullmann - stefan.cullmann [at] dotnetnuke.com
form and List will be the successor of the User Defined Table module.
----------------------------------------------------------------------
Do you want to import external data to form and List /User Defined Table?
Check out http://www.codeplex.com/Csv2UDTImport
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  User Defined Ta...  Query Parameters to filter results based on a Custom Profile Field
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Subzero Solutions
Dutch / English DotNetNuke consultancy services. Custom module development in any version. Complete application integration. Small business portal hosting. Your ideas our innovation - Your success our motivation. K.v.k Amsterdam: 34236342
www.subzero-solutions.net
Hosting for DotNetNuke
SiteGround.com is the best place to host your DotNetNuke website! Expert DotNetNuke support, reliable servers, low price!
www.SiteGround.com
Code Endeavors, LLC
Do you Endeavor to Enhance your DotNetNuke designs by utilizing AJAX technologies to more efficient interactive web experiences
www.codeendeavors.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP