Add Data via API in Custom Subform of Custom Module

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"}"

However, if I look at this article, I should be able to do it.

You'll find a screenshot of my API names attached.

Here's my sample code:

  1. // get list of all active users users_crm = zoho.crm.getRecords("users",1,200,{"type":"ActiveUsers"});
  2. // convert map to list users_list = List(users_crm.get("users"));
  3. // 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")); }
  4. // fetch the CRM user id with the Creator user email user_id = email_Id_Map.get("zoho@email.com");
  5. // fetch the CRM account info using account number accounts = zoho.crm.searchRecords("Accounts","(accountnumber:equals:WP20-369)");
  6. // 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"); }
  7. // 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"));
  8. // 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);
  9. info create_Subform;
Thank you!