jerops
river guide Posts:99
|
10-31-2011 01:01 PM |
|
On Dynamic Forms, I'm trying to display a textbox with the following as the SQL Driven Default Value:
Select name as DefaultValue from PLAN_ICSchool WHERE schoolID = '$(SCHLASIGN)'
SCHLASIGN is my custom membership profile that stores an ID number to represent a location and I'm trying to display the friendly name of the location.
Is this possible?
Thanks - Jerry |
|
|
|
|
Don Gee
river guide Posts:273
|
10-31-2011 08:36 PM |
|
Hi, For the query you mentioned above: Select name as DefaultValue from PLAN_ICSchool WHERE schoolID = '$(SCHLASIGN)' Go to the Advanced field options of the text box. Click the edit icon on the text box to get to the advanced field options. What do you get when you change the syntax of your query to: select name as default value from PLAN_ICSchool where schoolID = '$(SCHLASIGN)' and put that in the box for " Advanced Field Options" for the text box with radio button set to SQL driven options? |
|
|
|
|
jerops
river guide Posts:99
|
11-01-2011 05:33 AM |
|
Hi,
That is how I initially set it up and I get no results. If I set the DotNetNuke User Default to that membership field it returns an integer, as expected.
Any ideas?
|
|
|
|
|
Don Gee
river guide Posts:273
|
11-01-2011 01:08 PM |
|
Can you tell me what you get when you go to host>sql and run the following simple query: select * from PLAN_ICSchool. What kind of data shows up in each field? |
|
|
|
|
jerops
river guide Posts:99
|
11-01-2011 03:48 PM |
|
Okay...I ran that and the query and it returns data, I know the table and I do know that I'm using the correct column name.
I have access to SQL via SQL Studio Manager. So I created a view that aggregates the Users Table with Users Profile and PLAN_ICSchool table in a view called:vw_PLAN_FullUserProfile.
On the module I then use the following for the Advanced Field Option(SQL Driven)
SELECT name as DefaultValue FROM vw_PLAN_FullUserProfile WHERE UPUserID = '$(UserID)'
Now this works. But I had to create this view. What doesn't appear to work is if I try to use a membership profile field that isn't part the DNN core in the SQL Driven area.
If I set the DotNetNuke User Default to use SCHLASIGN then my value(SchoolID) shows up, but I want to display name column.
I'm using DNN 5.6.2 with the DS DF 03.50. version if this makes a difference.
I question boils down to "Doesn't Dynamic Forms support using DNN Tokens with the SQL Driven area?" Because as it stands now, it only appears to work with '$(UserID)'.
Thanks for responding, Jerry |
|
|
|
|
Don Gee
river guide Posts:273
|
11-04-2011 12:42 PM |
|
Hi Jerry, I think through all this you may have answered your question. In Dynamic Forms I have been taught that we can pull from DNN based on what is mapped there. In advanced field options there is the ability under sql driven options at: DotNetNuke User Default to select core integration default values. But unlike Dynamic Registration you can't map a value in Dynamic Forms like from your table to the core. I looks like you will have to settle for using the query that worked: SELECT name as DefaultValue FROM vw_PLAN_FullUserProfile WHERE UPUserID = '$(UserID)' to get your name field to come into the text box as a default. Maybe I am missing something but it seems like you would really benefit from having Dynamic Registration and then you wouldn't need the custom table you could create the custom profile fields for your users there and have the fields mapped to the core and then you would just select from the drop down for the defaults in Dynamic Forms the way you want to do things. Sorry if I haven't been more help but good luck
|
|
|
|
|
jerops
river guide Posts:99
|
11-04-2011 07:58 PM |
|
Don, Thank-you very much for your suggestions, it is very much appreciated. I think what's missing and maybe i didn't cleary describe the issue. I do have dynamic registration and use that. Within the DNN Core, I have created a custom membership profile field that is mapped to the school location. Within Dynamic Registration, the SQL Query works, but within Dynamic Forms the same SQL Query using the custom membership token does not work. It appears that dynamic Forms does not recognize DNN Membership Token unless it's UserID. So what I'm leaning to is that Dynamic Forms doesn't have the same functionality regarding setting values via SQL Query like Dynamic Registration does. Hope this makes sense and again thanks for taking the time to try to help me. Jerry |
|
|
|
|
Chad Nash Posts:5260
|
11-16-2011 02:45 PM |
|
Hi Jerry, You can still do what you are trying to do actually... It would be something more like this: Select name as DefaultValue from PLAN_ICSchool WHERE schoolID = (Select PropertyValue From UserProfile Where UserID = $(UserID) and PRopertyDefinitionID =500) That is assuming the property definitionID for the profile property ID is 500. Thanks, Chad
|
|
|
|
|
jerops
river guide Posts:99
|
11-16-2011 04:33 PM |
|
Chad, Thank-you very much for that tip! It's very useful! Is Dynamic Forms capable of using my field $(SCHLASIGN)' as a DNN token in the query. Or is only UserID the only DNN Token recognized by Dynamic Forms. What are the DNN Tokens besides UserID that's available Dynmaic Forms? I tried looking for them in the documentation but couldn't find them. Thanks Jerry |
|
|
|
|
Chad Nash Posts:5260
|
11-17-2011 10:50 AM |
|
Hi Jerry - Well, only the UserID I believe... There might be an option, if you had a "Hidden" field that had a "DotNetNuke User Default" option specified and the short field name was set to SCHLASIGN. Then it would work... basically that data is brought in as a hidden field and therefore you can use it then. Thanks, -Chad
|
|
|
|
|