Initial SQL Bind does not respect Language!
Last Post 10-15-2012 08:27 AM by Ryan Bakerink. 3 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages Not Resolved
Roel BroersmaUser is Offline
wading in the water
wading in the water
Posts:24
Avatar

--
10-11-2012 01:26 AM

    The Initial SQL Bind does run at the beginning of a form, however it does not take the currentlanguage into account when doing the SQL query.

    To reproduce:

    1) Make a form with only 1 DATE field.

    2) Setup Initial SQL Bind to the form so it will load the DATE field from the Database.

    After you enter the date and submit the form, the date is saved into the database.
    NOW:  Change your language (example: Dutch) and go to the Form.

    The date is loaded form the database (because the Initial SQL Bind) BUT the date is in English format, NOT in Dutch.

    I've even tried setting the following all above in the Initial SQL Bind field (before doing the bind query), but it doesn't matter.

    IF '$(CurrentLanguage)'='NL-nl' BEGIN SET LANGUAGE Dutch END

    Is this a bug?

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

    --
    10-11-2012 08:49 AM
    Hello Roel,

    Unfortunately this is an issue on the SQL side of things. Dynamic Forms has no idea how to show a date in a certain format if the page is being viewed in a particular language.

    You may want to consider working on your query in the Initial SQL Bind section of your Dynamic Form. Here's what I would do if the date needs to be a different format based on the LanageCode on the page:


    Select (case when '$(LanguageCode)' = 'NL-nl' THEN Convert(char(10), getDate(),103) ELSE Convert(char(10), getDate(),101) END) As DateShortFieldName

    SO the focal point is that you can conditionally change the Date format based on the LanguageCode.



    PLEASE NOTE:

    The DATE Question type in Dynamic Forms only works with US Date Format. You may need to use a Textbox instead and configure a Datepicker. You can learn more on configuring Date fields for Dynamic Forms on Demonstration 28:
    http://www.datasprings.com/formdemos


    Please let me know if this assists you, or if you have any questions.

    Thanks,

    Ryan
    Roel BroersmaUser is Offline
    wading in the water
    wading in the water
    Posts:24
    Avatar

    --
    10-15-2012 05:17 AM

    Hello Ryan,

    I don't think this is an SQL thing but it's an DynamicForm issue.
    SQL 'knows' the language, that's why I can use a query like:

    IF '$(CurrentLanguage)'='NL-nl' BEGIN SET LANGUAGE Dutch END
    SELECT order_date FROM tbl_orders

    But when DynamicForms wants to bind the actual value to the field, it does not take the CurrentLanguage into account.

    -Roel

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

    --
    10-15-2012 08:27 AM
    Hello Roel,

    $(CurrentLanguage) is a token in Dynamic Forms that renders to the language in which the page is currently being viewed in for the current user.

    $(CurrentLanguage) is not a SQL Reserved word.

    Does $(LanguageCode) or $(CurrentLanguage) return a value??

    Can you go to Module Configuration -> Advanced Coding Options -> Custom JAvaScript file -> Initial JavaScript and use this JavaScript:
    ---------------------------------------------------------
    alert($(CurrentLanguage));
    alert($(LanguageCode));
    ---------------------------------------------------------

    Can you then Update Settings and Reload the page.

    Does either of these Pop Up Boxes show the correct Language Code Value?

    Please let me know.

    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