Skip to content

Instantly share code, notes, and snippets.

@diter14
Last active October 26, 2017 19:47
Show Gist options
  • Select an option

  • Save diter14/2e6a124be5e81a799d4cccf79a3259fd to your computer and use it in GitHub Desktop.

Select an option

Save diter14/2e6a124be5e81a799d4cccf79a3259fd to your computer and use it in GitHub Desktop.
Iterar Productos en Cotizaciones - Zoho CRM

Iterar Productos desde Cotizaciones - Zoho CRM

Zoho Deluge

  • Obtener récord de módulo de venta específico (Cotizaciones, Orden, Factura...)
record = zoho.crm.getRecordById("ModuleName",recordId);
  • Extraer arreglo de productos del récord
products = quote.get("product").toJSONList();
  • Iterar sobre el arreglo de producto para obtener columnas específicas
for each product in products
{
    item = product.toMap();
    content_column_string = item.get("NameColumStr");
    ...
    content_column_integer = item.get("NameColumnInt").toLong()
    ...
}

Estructura de respuesta, solicitud para obtener récord

{
  "Moneda Formateada": "TEST",
  "Discount": "0",
  "SMCREATORID": "00000000000000000000",
  "Total Inicial": "00000",
  "Tax": "0",
  "SMOWNERID": "00000000000000000000",
  "Exchange Rate": "0.000000000",
  "Departamento de facturación": "Test",
  "CONTACTID": "0000000000000000000",
  "Valid Till": "0000-00-00",
  "Sub Total": "000000",
  "Número Cotización": "00000000000000",
  "Modified By": "Test Name",
  "Número de cuotas": "3",
  "Account Name": "Test",
  "Billing Code": "49568",
  "Plazo de entrega en días": "0",
  "QUOTEID": "2625102000000156005",
  "Total de Intereses": "-00000",
  "Billing City": "TEST",
  "Currency": "TST",
  "ACCOUNTID": "0000000000000000000",
  "Garantía en meses": "00",
  "Opcional de compra 1": "Test",
  "Grand Total": "00000",
  "Opcional de compra 1_ID": "00000000000000000000",
  "Inicial (%)": "00",
  "product": "[{Product Id=00000000000000000000, Discount=0.00, Net Total=0000.00, Quantity in Stock=-1.0, Product Name=Test, Total=00000.00, List Price=2000.00, Quantity=1.0, Tax=0.00, Unit Price=2000.0, Total After Discount=2000.0}]",
  "MODIFIEDBY": "00000000000000000000",
  "Adjustment": "0",
  "Contact Name": "Test",
  "Quote Owner": "Test Name",
  "Días de validez de la oferta": "0",
  "Modified Time": "0000-00-00 00:00:00",
  "Subject": "TEST",
  "Created Time": "0000-00-00 00:00:00",
  "Total Inc. Intereses": "00000",
  "Billing Street": "test",
  "Interés (%)": "0.0",
  "Descripción opcional de compra 1": "Test",
  "Descripción opcional de compra 2": "---------------------------------------",
  "Potential Name": "Test",
  "Created By": "Test Name",
  "POTENTIALID": "0000000000000000000",
  "Forma de pago": "Test"
}

  • Doc
https://stackoverflow.com/questions/40777490/how-do-i-use-deluge-to-parse-the-products-list-in-a-zoho-sales-order-or-po-quo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment