Default Value
Last Post 04-22-2013 05:37 AM by Ryan Bakerink. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Mike StuartUser is Offline
wading in the water
wading in the water
Posts:25
Avatar

--
04-21-2013 07:45 PM
    Hi

    We have a form field that should default to a specific value based on whether a user is logged in to the DNN site.

    How do we accomplish this?

    Thanks
    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    04-22-2013 05:37 AM
    Hello Mike,

    I would first recommend to use a SQL Default value for this field. Then you can build a conditional SQL Statement by using the $(UserID) token in Dynamic Forms.

    If a User is logged in the $(UserID) token will render to the appropriate ID of the User. If a user is unauthenticated then $(UserID) will render as '-1'.

    Based off of this logic alone, you should be able to create a conditional SQL Statement:

    IF '$(UserID)' <> '-1'
    BEGIN
    Select 'LoggedIn' As DefaultValue
    END

    ELSE
    BEGIN
    Select 'NotLoggedIn' As DefaultValue
    END

    I hope this assists you.

    Please let us know if you have any questions.

    Thanks,

    Ryan


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