Help Needed: IndiaMART CRM Integration Not Showing All Leads in ERPNext

Hello Frappe Community,

I’m integrating IndiaMART leads into ERPNext CRM, but I’m facing an issue where not all leads and data are showing up in the system. Here’s my setup:

  • IndiaMART API is correctly fetching leads.
  • I’m using a custom script to store lead data in ERPNext.
  • Data is supposed to be saved in the Lead Doctype, but only some records appear.
  • Bench and database are running fine, and no errors appear in logs.

Issues I’m Facing:

  1. Some leads are missing in CRM > Leads.
  2. Data sync works intermittently but doesn’t update all fields properly.
  3. No clear error logs, making debugging difficult.

What I Need Help With:

  • Debugging why not all leads are getting stored.
  • Verifying if my Frappe API calls are structured correctly.
  • Checking database sync issues with MariaDB.
  • Best practices for IndiaMART to ERPNext integration.

Has anyone successfully implemented IndiaMART lead management in ERPNext? Any guidance or sample working implementations would be greatly appreciated!

Thanks in advance! :pray:

The problem should be here. Why dont you check if doing a commit after each record helps.