Integrate Zoho CRM and Zoho Workdrive
I am having some trouble with my workdrive connection in zoho crm. What I want to do is this:
1) Create a folder for each account record in workdrive team folder, name it after the account name field
2) For each upload to a record in the deals module, send the file to the corresponding workdrive account folder
I have an oauth connection with WorkDrive.workspace.ALL, WorkDrive.files.Create, and WorkDrive.teamfolders.Create scopes. I tried to create a button function that would allow me to mass action create the workdrive folders from the accounts module. The below code gives me the error: id: 'F6016' , title: 'URL Rule is not configured' }
- void automation.createAccountFoldersWorkdrive(int accountId)
- {
- // Fetch account details
- accountDetails = zoho.crm.getRecordById("Accounts", input.accountId);
- accountName = accountDetails.get("Account_Name");
- // Replace this with your actual "Litigation" folder ID from WorkDrive
- litigationFolderId = "fgoh36f8283418f8f4b588e39cab0b6c351d9";
- // Step 1: Create Account Folder
- createFolderBody = map();
- createFolderBody.put("name", accountName);
- createFolderBody.put("parent_id", litigationFolderId);
- createFolderResponse = invokeurl
- [
- url: "https://workdrive.zoho.com/api/v1/folders"
- type: POST
- connection: "workdrive2"
- body: createFolderBody.toString()
- ];
- info createFolderResponse;
- if (createFolderResponse.containsKey("data"))
- {
- accountFolderId = createFolderResponse.get("data").get("id");
- subfolderNames = list();
- subfolderNames.add("Appraiser Attachments");
- subfolderNames.add("Attorney Attachments");
- for each name in subfolderNames
- {
- subfolderBody = map();
- subfolderBody.put("name", name);
- subfolderBody.put("parent_id", accountFolderId);
- subfolderResponse = invokeurl
- [
- url: "https://workdrive.zoho.com/api/v1/folders"
- type: POST
- connection: "workdrive2"
- body: subfolderBody.toString()
- ];
- info "Created subfolder: " + name;
- info subfolderResponse;
- }
- }
- else
- {
- info "Failed to create the account folder.";
- info createFolderResponse.toString();
- }
- }