Add Data via API in Custom Subform of Custom Module
Hello everyone,
I'm writing a custom function in Zoho Creator to create a Record in a custom module in Zoho CRM "On Success".
So far, so good, the Custom record is created but when I try to add data to the subform within it, I get an error message :
{"code":"NOT_SUPPORTED","details":{},"message":"the given module is not supported in create or update","status":"error"}"
You'll find a screenshot of my API names attached.
Here's my sample code:
- // get list of all active users
users_crm = zoho.crm.getRecords("users",1,200,{"type":"ActiveUsers"});
-
// convert map to list
users_list = List(users_crm.get("users"));
-
// create map with emails as key and id as values
email_Id_Map = Map();
for each user in users_list
{
email_Id_Map.put(user.get("email"),user.get("id"));
}
-
// fetch the CRM user id with the Creator user email
user_id = email_Id_Map.get("zoho@email.com");
-
// fetch the CRM account info using account number
accounts = zoho.crm.searchRecords("Accounts","(accountnumber:equals:WP20-369)");
-
// update the Creator record with the CRM account infos
if(accounts.size() > 0)
{
account = accounts.get(0);
account_id = account.get("id");
// input.Rue = account.get("Billing_Street");
// input.Ville = account.get("Billing_City");
// input.Account_Name_Creator = account.get("Account_Name");
}
-
// create a CRM installation record and link it the the right CRM account and USER id
parent_install_infos = Map();
parent_install_infos.put("Compte",account_id);
parent_install_infos.put("Name","HardcodedTest");
parent_install_infos.put("Owner",user_id);
parent_install_infos.put("Created_By",user_id);
create_Installation = zoho.crm.createRecord("Installations1",parent_install_infos);
// fetch CRM installation record ID
installation_id = toLong(create_Installation.get("id"));
-
// create Subform in installation module
kits_info = Map();
kits_info.put("Parent_Id", installation_id);
kits_info.put("serial_number", "TEST_SRN_HC");
kits_info.put("Version_Panneau", "E");
create_Subform = zoho.crm.createRecord("Kits", kits_info);
- info create_Subform;
Thank you!