toLowerCase Problems

toLowerCase Problems

My application includes several forms which each ask for the users name and email address. The email address is used as the identifier to cross reference records on all forms for fetching data and lookup fields.

Everything was working fine until I realized that is a user inputted their email address with different capitalization, the scripts would not be able to match up their records because strings are case sensitive.

I looked at these hep articles  <string>.toLowerCase()  and  Built-in-functions - String  and began to add 

input.Email = input.Email.toLowerCase();

to every script relating to email fields. To my horror, when I accessed my application some forms would not open, some fields would get stuck.

I found this support article  Enforce Lowercase which confirmed my suspicions that my forms and fields were hung in endless loops. So I tried the first suggestion and I made a separate field email_look_up which would store the email address all in lower case.

My scripts now had lots of

input.email_look_up = input.Email.toLowerCase();

I was still having looping issues. 

So I tried employing the second suggestion

if (input.Email  !=  input.Email.toLowerCase())
{
    input.email_look_up = input.Email.toLowerCase();
}

This cleared up many of form loading issues, but individual fields that depended on fetch and lookup are still hanging.

This field is supposed to collect a users email address and then auto populate the First and Last name fields based on their record fetched from the New_Application form. But it loops hopelessly.

if (input.Email  !=  input.Email.toLowerCase())
{
    input.email_look_up = input.Email.toLowerCase();
}
myapplication  =  New_Application  [email_look_up == input.email_look_up];
input.First_Name = myapplication.First_Name;
input.Last_Name = myapplication.Last_Name;

Then I wondered if it were looping because the if block could pass false if the Email was in fact lower case and then the script would not execute correctly. So I tried

input.email_look_up = input.Email;
if (input.Email  !=  input.Email.toLowerCase())
{
    input.email_look_up = input.Email.toLowerCase();
}
myapplication  =  New_Application  [email_look_up == input.email_look_up];
input.First_Name = myapplication.First_Name;
input.Last_Name = myapplication.Last_Name;

But that didn't fix it. I need help.

    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner









                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources

                                                                                              Zoho Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方