Help with "Record Not Found"

Help with "Record Not Found"

"Record Not Found" is not necessarily an error message, but a situation I want to prevent from disabling my Deluge script, and allowing it to finish with some alternative output. In it, The code is in a CRM custom function, and I'm searching for a record in the "Products" module of the CRM.

productSearchCriteria="(Product Name|=|" + ws1 + ")";
productSearchResults = zoho.crm.searchRecords("Products",productSearchCriteria);

This 2 line approach is necessary because "ws1" is a variable.

The problem I've observed is that if the value of ws1 is not found in the Products module, the script seems to end.
I've tried putting in a test for the size of the maplist(?) "found" in the search...

if(productSearchResults.size()  !=  0)

but that does not seem to work.

I'm wondering if I should be approaching this differently by using searchRecordsByPDC instead. Will that provide a means to catch a failed search and allow the script to finish?
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

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

                            Zoho CRM コンテンツ




                              ご検討中の方