Copying Files Between Modules

Copying Files Between Modules

Hi,

I'm creating a Deluge script and I've hit a roadblock. I'm trying to copy files from one module (let’s call it Module A) into another one (Module B).

Here’s what I’m doing:

  1. record = zoho.crm.getRecordById("Module_A", record_id);
  2. files_toCopy = record.get("Files_From_A");

  3. files = List();
  4. file = Map();

  5. // I omitted the for-each loop for clarity
  6. // file_Id – at this point, the files are stored in ZFS and I'm retrieving the encrypted ID
  7. file.put("file_id", files_toCopy.get(0).get("file_Id"));
  8. files.add(file);

  9. update.put("Files_From_B", files);
  10. zoho.crm.updateRecord("Module_B", some_id, update);
I'm not getting any errors, but the files are not being copied to Module B.

Any idea what might be going wrong, or if there’s something I’m missing? Thanks in advance!