Getting below error in zohobooks custom button function

Check and update the code in line 6 as there is a Exception : Data type of the argument of the function 'get' did not match the required data type of '[BIGINT]'

organizationID = organization.get("organization_id");
invoiceID = invoices.get("invoice_id");
customer_name = invoices.get("customer_name");
organizationID = organization.get("organization_id");
customer_id = invoices.get("customer_id");
invoiceTotal = invoices.get("total");
invoice_number = invoices.get("invoice_number");
json = Map();
json.put("invoice_id",invoiceID);
json.put("invoice_total",invoiceTotal);
json.put("customer_name",customer_name);
json.put("invoice_number",invoice_number);
json.put("customer_id",customer_id);
url = "https://example.com";
response = invokeurl
[
    url :url
    type :POST
    parameters:json
];
info response;
resultMap = Map();
resultMap.put("message",response);
resultMap.put("code",0);
return resultMap;


send list of invoices with invoice id,invoice total,customer name etc to my webhook server

1

There are 1 best solutions below

0
Ockert Cameron On
  1. Make sure your zoho zone function map is correct (invoices vs invoice).
  2. To use a Json payload, change the invoke call as demonstrated below:
    organizationID = organization.get("organization_id");
    invoiceID = invoice.get("invoice_id");
    customer_name = invoice.get("customer_name");
    organizationID = organization.get("organization_id");
    customer_id = invoice.get("customer_id");
    invoiceTotal = invoice.get("total");
    invoice_number = invoice.get("invoice_number");
    json = Map();
    json.put("invoice_id",invoiceID);
    json.put("invoice_total",invoiceTotal);
    json.put("customer_name",customer_name);
    json.put("invoice_number",invoice_number);
    json.put("customer_id",customer_id);
    url = "https://example.com";
    response = invokeurl
    [
        url :url
        type :POST
        parameters:json.toString()
        detailed:true
        content-type:"application/json" 
    ];
    info response;
    resultMap = Map();
    resultMap.put("message",response);
    resultMap.put("code",0);
    return resultMap;