Quick login...
 

 

DNN Modules
SnowCovered Top Sellers

Ultra Media Gallery is the most popular photo gallery and media gallery solution for DotNetNuke, UMG offers 10 different flash player to browse your gallery with completely different user interface experience.

Powerful, Ajax Enabled, Easy to Use. Document Management and Multimedia gallery functionality in one.Open-DocumentLibrary allows DotNetNuke users to organize share and manage documents, offering granular control over Folder and Document access.

Active Social is customizable social networking solution that fits the needs of a large company, small group, start-up business, or any size interest group. Connect with co-workers, people with similar interests, family, old friends, or meet new ones. Active Social provides a complete communication

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

In this day and age, knowing as much detailed information as possible about your customer, prospect or web site user is essential. Thankfully, the new 'Dynamics Forms' module from Data Springs, makes it easier than ever to segment your data collection efforts.

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet and play them in our integrated flash video player.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

The amazing ANY COLOUR Flex2 skin + our unique EasyMod module allowing you to customise just about everything in this skin. DrNuke just re-wrote the rule book again.

The Future of Enterprise Search for DotNetNuke 3.x and 4.xOpen-SearchEngine provides DotNetNuke with a true enterprise search engine capable of indexing html content as well as documents from multiple sites and/or physical directories.

Capture your users attention, enrich your site with multimedia flash, and create and opt in distribution list for your DNN site. These are just a few of the many features the Data Springs Module Collection can provide you.

Recently Viewed...
DNN Modules
   
    |   Register   |   Wednesday, March 17, 2010   
Hi Everyone!

You'll notice that we implemented a small change where your first and last name are now displaying in the forums.  If you do not wish to display your last name, please update your user profile and add a display name.  You'll find this by clicking on your name at the top of the page (right next to the Logout link).  Thanks!

Data Springs Product Forums...
Subject: Stored Procedures and passing $(UserId) in a RadionBox
Prev Next
You are not authorized to post a reply.

Author Messages
Jon
Posts:20
going with the flow
going with the flow

06/18/2009 6:43 PM  

Hi, it's me again

 

I have a reg form that contains a RadioButton Group.  I want to generate the options via an SQL call to a stored procedure.

 

The SP accepts a single argument, the $(UserID).  From this value, the  QuestionOption and QuestionOptionValues can be generated.

 

I call the SQL like this (in the 'SQL Driven Options' box):

 

exec GenerateUpgradeOptions $(UserId)

 

 

I cannot for the life of me get $(UserID) to actually be passed - indeed the 'Test SQL' generates an error.  If I replace $(UserID) with a 'hardcoded' userid like:

 

exec GenerateUpgradeOptions 278

 

It works fine and generates the correct options and their values (though it's only valid for Userid = 278 obviously).  Is there a way to pass in the current $(UserID) to this procedure?  Any ideas?

 

Thanks.

David To
Posts:2132
river guide
river guide

06/19/2009 8:45 AM  
HI Jon, try this method. Create a hidden field called HiddenID and set it using SQL driven option: select userid from users where userid = $(UserID)

Then change your radio button SQL to: exec GenerateUpgradeOptions $(HiddenID)

See if this works for you. -- David
Jon
Posts:20
going with the flow
going with the flow

06/19/2009 3:35 PM  

David, I have tried various combinations of this and have had no luck.  To keep things simple, I first just created a simple textfield for ease of testing (located after the username/password/confirm password fields).

 

I tried the following as part of the SQL driven content for this text field:

 

select userid AS DefaultValue from users where userid = $(UserId)

 

The field is empty when displayed.  I have a Username field as the first field in this form, which does display the logged in username.  I also tried just hardcoding the userid as so:

 

select userid AS DefaultValue from users where userid =331

 

Same result (blank field).

 

So, since I have a Username field on the form (which does display the Username properly) I thought I would try something 'sneaky' like:

 

select userid AS DefaultValue from users where username = '$(Username)

 

That also results in an empty textbox.  So far I have been unable to get any of these to work.  The documentation does indicate UserID is valid here, but niether that, nor any existing field name (Username) results in anything other than a blank text field.  

 

I also found this thread:  https://www.datasprings.com/Products/ProductForums/tabid/727/forumid/3/tpage/1/view/topic/postid/862/language/en-US/Default.aspx#862

 

Is this really the case?  Is there *anyway* for my stored procedure (or any other SQL driven field) to be able to key on the current user in someway?  Surely this must be possible and I'm just missing something...?

 

Not sure what to try next.

 

 

Jon
Posts:20
going with the flow
going with the flow

06/19/2009 3:58 PM  

For kicks, I tried the exact example given below the SQL field entry box: 'select count(*) As DefaultValue from users'.  This to ends up with an empty textbox.  What could be the problem here? 

Jon
Posts:20
going with the flow
going with the flow

06/19/2009 6:27 PM  

For kicks, I've created a test reg form on beta springs.  It's at: http://www.betasprings.com/DynRegistration/tabid/283/language/en-US/Default.aspx  (I wasn't able to create a new page - Got a 'primary storage full' error).  The module is called ' Jon's SQL tests Hidden field. visible test field using sql'. 

 

It has a hidden field, a textfield, and an radiobutton field, all driven by SQL.  Only the radiobutton field actually works, though tokens like $(UserID) (or any others I tried) do not work.

 

The hidden field is not found at all via 'View Page Source' in FF. 

 

Clearly the version of DR on betasprings is newer than what we have (3.2.70), but it still seems to have the same problems.

 

Any pointers would be appreciated.

 

David To
Posts:2132
river guide
river guide

06/20/2009 10:09 PM  
Hi Jon, another question. Can you go to Host / SQL and type in:
select count(*) As DefaultValue from users

Do you get anything returned? If not, chances are that your DNN instance is using object qualifier. Then try to execute this:
select count(*) as DefaultValue from {objectQualifier}users

-- David
Jon
Posts:20
going with the flow
going with the flow

06/21/2009 12:23 AM  
Hi David - yes this SQL works fine in Host->SQL. Previously I mentioned a betasprings page that shows these problems - did you see that?


I found that only using the 'ComboBox' can I get the SP to run with the $(UserID) token being valid. On the betaspings (and our site) site, the hidden and text fields cannot be initialized via SQL at all (even using the example you give). The RadioButton can, but the $(UserID) token, or any other token I could think of, is not available. If I wasn't being clear - these are all initialization SQL events, not Question or form CE's.


For my case, what I wanted to do was dynamically build a Radiobutton group via SQL based on the UserID, since that will determine what options are actually available for the given user. For Radiobox, SQL init will work, but without $(UserID) (or any other token I could think of) being available, it's useless for my needs. I hope this is a little clearer.



Chad Nash
Posts:3346
river guide
river guide

06/21/2009 2:07 PM  
Hi. The original query should have worked for SQL Options for sure. Keep in mind that the SQL default values are only 'defaults' for initial registrations and not when you are signed in.

Keep in mind that parameters don't work when you click 'Test SQL', only on the user-facing form. So if you go to host, sql and enter:
exec GenerateUpgradeOptions 278

What records get generated? Are those columns names 'QuestionOption' and 'QuestionOptionValue'? The query would need to return those two columns specifically.

The $(UserID) query is referenced in SQL options a lot so I am not sure why it wouldn't work. I know the SQL Default is only for initial (default value) registrations and not when you are signed in so I understand why that wouldn't work, but not sure. Ill review the beta springs page you created.

-Chad
Jon
Posts:20
going with the flow
going with the flow

06/23/2009 1:53 PM  

David, sorry for the delay in response.  I was not aware that SQL defaulting would only work for initial registrations - I guess if the fields were not tied to core dnn fields, I didn't see why that should not work.  I was aware that 'Test SQL' would not work when tokens are involved.

 

For the radiobutton, you asked 'So if you go to host, sql and enter:
exec GenerateUpgradeOptions 278
'

 

Yes this works fine as I mentioned previously.  It's only when I supplied $(UserID) that it did not work.

 

What records get generated? Are those columns names 'QuestionOption' and 'QuestionOptionValue'? The query would need to return those two columns specifically.

 

Yes, when called directly as mentioned above, the correct values are generated.

 

The $(UserID) query is referenced in SQL options a lot so I am not sure why it wouldn't work. I know the SQL Default is only for initial (default value) registrations and not when you are signed in so I understand why that wouldn't work, but not sure. Ill review the beta springs page you created.

 

Yes, and it was even documented that way which is why I tried it.  On the betasprings site mentioned above, I created a radiobutton that was init'd via SQL.  Using all 'hardcoded' values works (As you can see).  Add $(UserID) and it stops working.

 

At anyrate, I decided to ditch DR and give Dynamic Forms (DF) a try.  With DF, it all worked as expected, and that's what we are now using for the upgrade form.

 

 

 

David To
Posts:2132
river guide
river guide

06/25/2009 3:11 PM  
HI Jon, we'll need to check out DR as to why it's not accepting $(UserID) on radio buttons but glad you made the switch to DF and it's working out for you . -- David
You are not authorized to post a reply.
Forums > Product Discussion - DotNetNuke Modules > Dynamic Registration > Stored Procedures and passing $(UserId) in a RadionBox



ActiveForums 3.7
Copyright 2005 - 2010 by Data Springs, Inc.
Terms Of Use | Privacy Statement