getRecords - Avoid duplicates

getRecords - Avoid duplicates

Hello community, 

I'm maintaining  a Vendors table in creator, fetching data from Zoho Books. The vendor table can not contain duplicates for consistency in the records of my app. That's why I've checked the "No Duplicates" option on the contact_id fetched from Books. 

The issue now is that everythime I'm running the function to get records, I receive an error message because of finding duplicate values. How can I skip duplicates in the function below ?

Thanks a lot for your help. 

  1. void Get_Suppliers()
  2. {
  3. query_param = Map();
  4. query_param.put("contact_type","vendor");
  5. response = zoho.books.getRecords("vendors","00000","query_param","booksconnection");
  6. data = response.getJSON("contacts");
  7. for each  getdata in data
  8. {
  9. vendor_name = getdata.getJSON("vendor_name");
  10. contact_id = getdata.getJSON("contact_id");
  11. contact_type = getdata.getJSON("contact_type");
  12. insert into SUPPLIERS
  13. [
  14. SUPPLIER_NAME=vendor_name
  15. SUPPLIER_ID=contact_id
  16. CONTACT_TYPE=contact_type
  17. Added_User=zoho.loginuser
  18. ]
  19. }
  20. }

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




                              ご検討中の方