Tolower case - InfoPath Dev
in

InfoPath Dev

Tolower case

Last post 02-08-2006 01:04 AM by Agni Jonnalagadda. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 06-06-2005 08:24 AM

    • BrownR
    • Top 200 Contributor
    • Joined on 08-14-2004
    • USA
    • Posts 54

    Tolower case

    i have this string to pull the current user name into a field in my load code.

    XDocument.DOM.selectSingleNode("//dfs:myFields/dfs:dataFields/d:ReportInfo/@Login").text= objWscript.UserName;

    BUT i need it to go into my SQL database as all lower case. Right now if they log in in upppercase it causes some issues in my database. Any idea on this?
  • 06-12-2005 04:32 AM In reply to

    Hello
    You can use the translate function to solve your issue. The line above will look like this

    XDocument.DOM.selectSingleNode("//dfs:myFields/dfs:dataFields/d:ReportInfo/@Login").text= translate(objWscript.UserName, "QWERTYUIOPLKJHGFDSAZXCVBNM", "qwertyuioplkjhgfdsazxcvbnm");

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 06-16-2005 08:53 AM In reply to

    • BrownR
    • Top 200 Contributor
    • Joined on 08-14-2004
    • USA
    • Posts 54
    Im a little lost, I understand what translate does but how will it make the translation that i need? Could you give me a little bit of detail on what this part does?

    (objWscript.UserName, "QWERTYUIOPLKJHGFDSAZXCVBNM", "qwertyuioplkjhgfdsazxcvbnm");


    Thank you so much for helping me out.
  • 06-16-2005 04:18 PM In reply to

    What that will do it will take the value of objWscript.UserName and convert all the characters to lower case.

    What you can do to test this. Design a new form which has a textbox and an expression box. Now set the value of the expession box by using translate function on the textbox. Now even if you enter capital letters in the textbox it will show the same letters in lower case in the expression box.

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 01-24-2006 01:06 PM In reply to

    • BrownR
    • Top 200 Contributor
    • Joined on 08-14-2004
    • USA
    • Posts 54
    Shanthi,
    Thank you so much for your reply. I've been able to get back to thi issue, and maybe time has helped, but i compltlly understand what your telling me what to do. But when i add that to my "On-Load" function , i get an error. "Object expected" is the error and does not work. Any idea?
  • 02-02-2006 10:39 AM In reply to

    • BrownR
    • Top 200 Contributor
    • Joined on 08-14-2004
    • USA
    • Posts 54
    Ok the "error" i was getting only happened in design mode. It works just fine in realtime run mode. From what i have read , the error, i was getting happens when it expects a value. And of course in design mode there is no value.
  • 02-03-2006 09:53 AM In reply to

    So this was failing in design mode when objWscript.UserName is null?

    Shanthi
    InfoPath Dev India
    Shanthi Reddy
  • 02-07-2006 08:15 AM In reply to

    • BrownR
    • Top 200 Contributor
    • Joined on 08-14-2004
    • USA
    • Posts 54
    Correct, it was giving the error when i tried the form in design mode, but worked without a flaw in realtime.
  • 02-07-2006 07:14 PM In reply to

    • hollis
    • Not Ranked
    • Joined on 01-29-2006
    • Australia
    • Posts 10
    Hi,

    In managed code you would be able to do: objWscript.UserName.ToLower();

    Is there no similar method in script???
  • 02-08-2006 01:04 AM In reply to

    "toLowerCase()" of javascript will convert all uppercase letters to lowercase.

    Agni
    InfoPath Dev India
Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.