Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListQuery Parameters to filter results based on a Custom Profile FieldQuery Parameters to filter results based on a Custom Profile Field
Previous
 
Next
New Post
6/16/2008 5:40 PM
 

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/17/2008 1:19 AM
 

You can help yourself.

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

 
New Post
6/17/2008 3:05 PM
 

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 2:22 AM
 

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" />

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListQuery Parameters to filter results based on a Custom Profile FieldQuery Parameters to filter results based on a Custom Profile Field


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out