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  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
 


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
1551 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
1551 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.

 


Easily Build DNN Solutions with XMod
XMod makes it easy to build news articles, house listings, custom feedback forms, product reviews and much more - without programming
www.DNNDev.com
Software Development and Integration with DNN
HNP Solutions focuses on the pragmatic use of technology and process to meet an organization's business objectives. HNP Solutions employs seasoned Enterprise and Solution Architects, Delivery Managers and QA & Business Leads. Our capabilities range from project assessments & recommendations, design & code reviews, to full program implementations. We also work with organizations in need of senior staff augmentation purposes in the areas of Enterprise and Solution architecture.
www.hnpsolutions.com
Alki Homes - Seattle, WA
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com

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