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.
- void Get_Suppliers()
- {
- query_param = Map();
- query_param.put("contact_type","vendor");
- response = zoho.books.getRecords("vendors","00000","query_param","booksconnection");
- data = response.getJSON("contacts");
- for each getdata in data
- {
- vendor_name = getdata.getJSON("vendor_name");
- contact_id = getdata.getJSON("contact_id");
- contact_type = getdata.getJSON("contact_type");
- insert into SUPPLIERS
- [
- SUPPLIER_NAME=vendor_name
- SUPPLIER_ID=contact_id
- CONTACT_TYPE=contact_type
- Added_User=zoho.loginuser
- ]
- }
- }
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.