Custom fields checkboxes are not boolean in Zoho Books
Hello all,
Today I discovered a very strange and curious thing I think it is worthy to be shared with all developers: in Zoho Books, checkboxes created as a custom field dont return a boolean value, they return true/false but as a string.
I was trying to avoid certain sales orders when making invoices and we created a checkbox to mark those sales orders and avoid them. This is a debug code I tried:
- urllista = "https://books.zoho.eu/api/v3/salesorders/?organization_id=" + organizationID + "&salesorder_ids=" + salesorderID;
- lista = invokeurl
- [
- url :urllista
- type :GET
- connection:"xxx"
- ];
- info lista;
- lista_ordenes = lista.get("salesorders").toList();
- for each findOrder in lista_ordenes
- {
- pedido_amazon = findOrder.get("cf_pedido_amazon");
- info pedido_amazon;
- }
- if(pedido_amazon != true)
- {
- info "No es Pedido de Amazon";
- }
The last condition was not working at all and the only way I had it working was making the condition with "true" instead of the boolean value true
Is this a normal behaviour? Maybe the toList() function takes off the values? Does anyone know something about this?