Error when using zoho.crm.getRecordById and no record found

Error when using zoho.crm.getRecordById and no record found

I am trying to use the zoho crm api function zoho.crm.getRecordById but get an error when this function does not find a value.

How can i prevent this error?

  1. Error in executing Set Variable task. Unable to update template variable crmRecord. Error evaluating MAP expression :

The code I am using is as follows:

  1. crmRecord = zoho.crm.getRecordById("Leads", quote.Lead_ID.toLong());

Some background on my applications...
When a lead is created in crm it passes the lead ID to creator. 
The trouble I have is when the crm lead is converted the Lead ID no longer exists and then this error arises.

I think i need to be able to check if the  crmRecord is null or has a zero record count. Since i cant use count function here how can i solve this problem if im getting the error just by using the api?



    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 コンテンツ




                              ご検討中の方