Question Event and SQL Query
Last Post 08-11-2009 11:46 AM by David To. 3 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
dmeiserUser is Offline
skipping stones
skipping stones
Posts:6
Avatar

--
08-11-2009 11:05 AM

    I need to setup a form that allows a user to change whether or not they receive the company newsletter via postal mail or via our intranet.  Since not all users have a unique login, I have to put all users into pull down list. 

    After they select their name, I need a question event to fire off a SQL event to go get their current mail settings.  In order to do this, I need the OptionValue of the pulldown menu.

    I'm using Dynamic Forms 3.0 and DNN 5.1.1.  Is there an easy way to accomplish this using Dynamic Forms?

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

    --
    08-11-2009 11:14 AM
    Yes, go to Control Panel / Question Events, create a new event and choose option "set question default based on another question response". Your affected default would be the email of the user picked (you can create a hidden field or textbox) to hold this email and the Initiation/postback question would be the pull down list. Pick SQL driven and type in your query to return a single value. -- David
    dmeiserUser is Offline
    skipping stones
    skipping stones
    Posts:6
    Avatar

    --
    08-11-2009 11:24 AM
    I think I might not be understanding you. The form will have three fields: "Your Name", "Currently Being Mailed" (true/false, locked), and "I want to change my mailing status" (true/false).

    When the user selects a name, I want "Currently Being Mailed" to be pulled from a SQL query set based on their response. So, after "Your Name" is set I need to somehow execute a query that says, "SELECT [MAILING] WHERE UserId = [TheQuestionOptionValue]" and then set that result into "Currently Being Mailed".
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    08-11-2009 11:46 AM
    Yes, you do it exactly the way I explained it.
    Let's say you have shortname fields:
    1) drop down list: YourName
    2) textbox or hidden field: CurrentlyBeingMailed

    3) Go to Control Panel / Question Events and create a new event, picking "Set Question default based on another question response"

    4) Your Initiation/postback question, pick YourName
    5) check the box for any response
    6) Affected question, choose: CurrentlyBeingMailed
    7) your affected question new default value; pick SQL driven and type in:
    select mailing from tablename where userid = $(YourName)

    Now I'm assuming "mailing" is a column that returns one value from a "tablename"; also the drop down list YourName has the userID as the optionvalue and firstname/lastname as the optiontext description. Try these steps out and see if it works for you. -- David


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