Fetching records From Zoho CRM

Fetching records From Zoho CRM

Hi,

I try to fetch records from Zoho CRM's two modules to a form in Zoho Creator.

The following script is written that is saved and runs without problems:

crmOrders = zoho.crm.getRecordById("SalesOrders", input.Order_Number_ID);
input.Contact_Name = crmOrders.get("Contact Name");
input.Billing_Country = crmOrders.get("Billing Country");
input.Order_Date = (crmOrders.get("Created Time")).toDate();

operationsList = zoho.crm.getRecords("CustomModule1");
for each operationDet in operationsList
{
operationNumber = operationDet.get("Order number").toLong();
if (equalsIgnoreCase(operationNumber.toString(), input.Order_Number_ID.toString()))
{
input.Quantity_For_This_Op = operationDet.get("Quantity For This Op").toLong();
input.Unit_Sale = operationDet.get("Unit Sale").toLong();
}
}

But only the part of the CustomModule1 doesn't bring the values of Quantity For This Op and Unit Sale to the form, regardless of their existence.
The "Order number" is a custom lookup field, i need to bring the values from the current CustomModule1 module, based on the Order number.

Please help,
Thank you very much