Zoho books custom function

Zoho books custom function

Hello,
I am trying to code custom function in Zoho Books that would change status of Invouce from draft to sent or paid but I cnat make it. Can you please help me with coding.

Code sample:

orgid = organization.get("organization_id");
invid = invoice.get("invoice_id");


jsonstring = "{\"status\" : \"sent\"}";

result = zoho.books.updateRecord("Invoices",orgid,invid,jsonstring.toMap());
info result;