Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save louka1996/dbcee8d921fe6beb2cb762a65515b37e to your computer and use it in GitHub Desktop.

Select an option

Save louka1996/dbcee8d921fe6beb2cb762a65515b37e to your computer and use it in GitHub Desktop.
Pushes the invoice subtotal from Zoho Books to the linked Deal in Zoho CRM.
// Get the associated CRM Deal ID and the invoice subtotal
invoiceDealId = invoice.get("zcrm_potential_id");
invoiceSubTotal = invoice.get("sub_total");
// Prepare the map to update the Deal
subtotal = Map();
subtotal.put("Amount", invoiceSubTotal);
// Retrieve the Deal details (optional if only updating)
dealDetails = zoho.crm.getRecordById("Deals", invoiceDealId);
// Update the Deal in Zoho CRM with the invoice subtotal
response = zoho.crm.updateRecord("Deals", invoiceDealId, subtotal);
info response;
@louka1996
Copy link
Author

Description

This Zoho Deluge script syncs the sub_total value from a Zoho Books invoice to a custom field (Amount) in the associated Deal record in Zoho CRM. The script retrieves the Deal using the CRM ID stored on the invoice, then updates the Deal with the subtotal. This ensures consistency between invoice data and CRM records, enabling better reporting and forecasting directly in Zoho CRM.

Ideal for automating revenue alignment between Books and CRM modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment