This script (courtesy of Zoho) will update existing records in a subform in one module (Accounts) from another Module (Deals). To create a cross-moduel subform entry (at creation for example), please see here ...
Requirements
Identify the subform API name ( under Settings|Developer Space|APIs)
Script
deal = zoho.crm.getRecordById("Deals",dealId); //dealId is created in the script by creating the argument
accId = deal.get("Account_Name").get("id");
acc = zoho.crm.getRecordById("Accounts",accId);
subform1 = ifnull(acc.get("API_Subform_Name"),"");
info subform1.size();
if(subform1.size() > 0)
{
sub_forms = List();
for each rec in subform1
{
oppId = ifnull(rec.get("Linked_Lookup_field_in Subform"),{"id":""}).get("id");
subform = Map();
subform.put("Linked_Lookup_field_in Subform",oppId);
if(oppId != "")
{
dealDetails = zoho.crm.getRecordById("Deals",oppId);
amount = ifnull(dealDetails.get("Your Field"),0.0);
stage = dealDetails.get("Your Field");
info amount;
subform.put("Subform_Field",amount);
subform.put("Subform_Field",stage);
}
sub_forms.add(subform);
}
info sub_forms;
parammap = Map();
parammap.put("API_Subform_Name", sub_forms);
update = zoho.crm.updateRecord("Accounts",accId,parammap);
}