Custom field fetch in items fails
Hey Zoho Community,
I've created a custom module in Zoho books which is called "Storage Bins". I'm looking up this custom module in ITEMS under the label "Bin Number"
In a custom function I want to fetch the value (Which I assume is the ID of the object in the custom module). For some reason I'm receiving null only. I either have a code issue or somethings wrong - maybe because it's still on beta?
Here's my code:
- //Standard fields fetch
- itemName = item.get("name");
- itemID = item.get("item_id");
- orgID = organization.get("organization_id");
- //Fetch custom fields
- item_custom_fields_initial = item.get("custom_fields").toList();
- for each item_custom_field_initial in item_custom_fields_initial
- {
- if(item_custom_field_initial.toMap().get("label") == "Bin Number")
- {
- bin_id = item_custom_field_initial.get("value");
- }
- break;
- }
- resultMap = Map();
- resultMap.put("message","Item Name : " + itemName + " ID " + itemID + " Bin ID " + bin_id);
- resultMap.put("code",0);
- return resultMap;
I tried using the API name which didn't work either.
Thanks heaps for your reply.
Ben