Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

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

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 or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

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

Using Dynamic Forms for personal messages - how?
Last Post 03-31-2009 07:57 AM by David To. 18 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
sheila DaleUser is Offline
skipping stones
skipping stones
Posts:13
Avatar

--
03-23-2009 02:47 AM

    Hi everyone, I have purchased dynamicforms.  I need a dnn administrator to be able to choose a dnn user id from a dropdown list and add a message for that user.  I then want a page where I can display that message to the dnn user when they login - and only they and admin can see it.  Does anyone know how I can:

    1. Fill a dropdown list with the dnn usernames (sql code needed)

    2. Display messages for specified user after they have logged in using Dynamic forms?

    This is an urgent request - would be very very grateful - thank you.

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-23-2009 06:47 AM

    HI Sheila, you can use the following sql query to populate your down box:
    select (firstname + ' ' lastname) as questionoption, userid as questionoptionvalue from users

    After they log in by clicking the submit button, you have a page redirection to another page that displays messages to the user. To set this page to be viewable only to certain users, you will need to create a "role" and assign users to the "role" and make the page viewable to the "role". -- David

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-23-2009 06:49 AM
    Actually, I forgot the + on the lastname; SQL query should be:

    select (firstname + ' ' + lastname) as questionoption, userid as questionoptionvalue from users
    sheila DaleUser is Offline
    skipping stones
    skipping stones
    Posts:13
    Avatar

    --
    03-23-2009 07:53 AM

    Hi David, you are a star! The first bit work great - my dropdown list is working.

    I dont think I explained myself very well for the second part however. The message should be displayed to a specific user - only one, and there could be many so I dont really want to set up a different page to redirect each user to. Is there anyway to make this a bit more dynamic and just show all messages submitted to the 'logged in' user (that was originally chosen in the dropdown list) -in a message box on the same page?

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-23-2009 08:20 AM
    Yes, but you will have to use client side javascript. You will need to string together a bunch of case statement and depending on the user, display a different message(ie: something like the following) to a textbox, label, etc.
    switch($(dropdownlistshortname))
    {
    case 'David To':
    $(labelmessage)='Welcome to my website'
    break;
    case 'Sheila Lastname':
    $(labelmessage)='You're the creator of this website'
    break;
    };

    -- David
    sheila DaleUser is Offline
    skipping stones
    skipping stones
    Posts:13
    Avatar

    --
    03-23-2009 08:45 AM
    Hi David,
    Is there a better way of doing this? It seems pointless using Dynamic Forms to capture data and not be able to use it to display in a dynamic way. Can you suggest anything that would more efficiently in this instance?
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-23-2009 09:01 AM
    The messages that you want displayed to a particular user, where does it come from originally? Are you creating an SQL table and storing a bunch of messages in there to begin with? If so, then there is a different approach to take. -- David
    sheila DaleUser is Offline
    skipping stones
    skipping stones
    Posts:13
    Avatar

    --
    03-23-2009 09:08 AM

    Hi David,
    Yes, I am using DynForms to save data to a table using a dropdown list with userids and a text box for the message. On completion (although I am having difficulties with the completion event at the mo) the captured data is saved to a table. I then want that data to be displayed - only where the message userid = the user logged in.

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-23-2009 09:31 AM

    Okay, if what you type in is correct, then you are missing the following:
    '$(UserID)'

    Also, for your GetDate(), do the following:
    1) create a shortfieldname called ResponseDateTime, set the default SQL option to: select Cast(GetDate() as nvarchar(20)) as DefaultValue

    Then pass the token '$(ResponseDateTime)' instead of the getdate().

    For accessing this page on another site, please see the form demo 14 concerning SQL Bind option. But I'll explain it briefly here also:

    Under Module Configuration of the page that's retrieving the data, check "Enable initial SQL Bind"

    Under "Only enable when querystring value is present", type in something like: ShowMessage

    In the "Initial SQL Query", type in your select statement:

    <!--[if gte mso 9]> <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:1627400839 -2147483648 8 0 66047 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> <!--[if gte mso 10]> select
    ([Message])
    from
    {databaseOwner}[{objectQualifier}DynamicForms_CustomTable_651]
    where
    ([Who is thi]='$(DSParam1)'

    NOTE the IMPORTANCE of DSParam1(it must be this name). This DSParam1 is the query string you are gonna use to pass the UserID from the other page. Another words, on the original page, change the "dropdownlist" shortfieldname to DSParam1 and then pass it as a query string to your 2nd page. Your completed querystring to the 2nd page would be something like:

    http://secondpage.com/default.asps?DSParam1=2&ShowMessage=True

     

    -- David

    sheila DaleUser is Offline
    skipping stones
    skipping stones
    Posts:13
    Avatar

    --
    03-25-2009 05:16 AM

    Hi David,

    I am getting a little bit lost with this. I followed your instructions and it is still not working so I think I have missed something.

    The process is:

    Admin access page1 and using a dropdownlist containing userid's and a text box submit a message for a specified user. Dynamic forms automatically saves this data to a table called DynamicForms_CustomTable_651.

    The specified user then logs in to page2 and views their own 'private' messages that Admin submitted earlier on page1.

    1. On page1, what completion event do I need to set up? And is there anything I need to do with the dropdownlist and the message box at this stage?

    2. Page2 - How do I use the current, logged in DNN userid and set up the Dynamic form module to view messages for that particular user - on page load? Can I use the DNN token userid to populate a label or text box in DynamicForms module on page2? If so, how?

    I need a step by step guide just to see this working once - then I can run with it and experiment to see what else I can do with this.

     

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-25-2009 07:39 AM
    Okay, on page 1:
    1) Drop down listbox / combobox (ie. shortname field of PickUser) would have an SQL default option of:
    select (firstname + ' ' + lastname) as questionoption,userid as questionoptionvalue from users
    2) textbox (ie. shortname of Message) for admin to type in message
    3) in the form completion event, choose event type of "Dynamic SQL Statement" and under the "Dynamic Field", choose for "Any Response"; this way it will run when you click the submit button of page 1; in the SQL statement, use SQL query to insert into the table:
    insert DynamicForms_CustomTable_651(UserID,Message) values ('$(PickUser)','$(Message)')

    On Page 2:
    1) create a textbox field (ie. shortname of UserName) and map it to default DNN core of Username

    ) create the textbox (ie. shortname of ViewMessage); use default SQL query:
    select Message as defaultvalue from DynamicForms_CustomTable_651 where userid in (select userid from users where username = $(Username)

    Try this out and see if it works. -- David
    sheila DaleUser is Offline
    skipping stones
    skipping stones
    Posts:13
    Avatar

    --
    03-25-2009 10:47 AM

    Hi David,

    Thanks for you support with regards to this.

    I have followed your guide and can confirm that the messages are being written to the table (I can view them in view report option) however, Page 2 - when the page loads, no message is shown in the message field.

    select Message as defaultvalue from DynamicForms_CustomTable_651 where userid in (select userid from users where username = $(Username)

    I added a bracket at the end also to see if this was the problem but still nothing.  Do I need to do a databind that you suggested previously?

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-25-2009 11:09 AM
    Can you go to HOST / SQL and type in the SQL statement with hard-coded value and see if it returns anything? Another words, try:
    select Message as defaultvalue from DynamicForms_CustomTable_651 where userid in (select userid from users where username = 'sheila')

    or some other hardcoded username. -- David
    sheila DaleUser is Offline
    skipping stones
    skipping stones
    Posts:13
    Avatar

    --
    03-25-2009 11:25 AM

    Hi David, i have changed the code to:

    select message as defaultvalue from DynamicForms_CustomTable_651 where userid =1

    and this seems to work - but it only shows 1 message for user id 1.

    I guess the bit of code that looked for the current user id did not work - any suggestions?

    Also, is there anyway of showing a list of all messages for a particular userid? There may be 3 or 4.

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-25-2009 11:57 AM

    Okay, let's do this better then. On page 2, change the ViewMessage shortfield from type textbox to combobox (or even better, a LISTBOX). On the SQL driven option, type in the following SQL:

    select message as questionoption, message as questionoptionvalue from DynamicForms_CustomTable_651 where userid = $(UserID)

    Try this out and see if it works. -- David

    sheila DaleUser is Offline
    skipping stones
    skipping stones
    Posts:13
    Avatar

    --
    03-26-2009 12:26 AM

    Hi David, thank you.  The list box and the sql code worked somewhat - when I changed the code to:

    select message as questionoption, message as questionoptionvalue from DynamicForms_CustomTable_651 where userid = 1

    Still not working with ...where userid = $(UserID)

    ??

     

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-26-2009 06:14 AM
    HI Sheila
    Try putting single quote around the userid like this:
    where userid = '$(UserID)'
    sheila DaleUser is Offline
    skipping stones
    skipping stones
    Posts:13
    Avatar

    --
    03-26-2009 07:38 AM
    No, sorry David, still get the "Error in SQL!" message.
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    03-31-2009 07:57 AM
    This has been taken offline. I was given admin privilege and gave her advice on making sure her custom database table DynamicForms_CustomTable_651 where she's pulling out the "userid" field should have a datatype of "int" for comparing to the dynamic token $(UserID). -- David
    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi