Workflow Custom Function for any existing Module for Box

Workflow Custom Function for any existing Module for Box

The Box extension for Zoho CRM is one convenient way to access stored data and share files with leads and contacts (by default) from Zoho CRM. You can extend this functionality to custom modules too. Follow the steps below to see how it's done.

To associate the above custom function to a workflow rule:

  1. Click Settings > Setup > Automation > Workflow Rules.
  2. In the Workflow Rules page, click the Create Rule button.
  3. In the Create New Rule tab, specify workflow rule parameters that you require.
  4. Execute the workflow during Record Actions. Select Create or Edit and click Next.
  5. Select All Records in the following options. Next, select Custom Function to be triggered under an Instant Action.
  6. Associate the custom call function to be triggered. Click Save.

To create custom buttons:

  1. Click the Settings > Setup > Customization > Modules.
  2. Click $Module of your choice$ > Layout.
  3. Drag and drop the Fields from the New Fields tab.
  4. Click Save.
//Note: the custom function should have "record_id" parameter

// getting record info from Leads or Quotes using the record_id
   
    quote_info = zoho.crm.getRecordById("Quotes", quote_id.toLong());

// Getting Box folder ID from the record info

    box_folder_id = quote_info.get("Box Folder ID");

   if ((box_folder_id  ==  null)  ||  (box_folder_id  ==  ""))

   {

      rootFolderId = zoho.crm.getOrgVariable("box.box_rootfolder_id");

        if (rootFolderId  ==  "")

        {

// Returning since the root folder ID is empty

            return;

        }

       tokenObj = map(); 	
       tokenObj.put("folder_name", "Quotes");

       tokenObj.put("parent", rootFolderId);

// Using the token object and Box connector to call the invoke connector 
      from CRM API
      createFlrResp = zoho.crm.invokeConnector
                     ("box.box.createboxfolder", tokenObj, true);
        if (createFlrResp  ==  null){

                 return;

            }
// Get the status code from the createFlrResp

        status_code = createFlrResp.get("status_code");

        quote_folder_id = "";

        resp_obj = createFlrResp.get("response");

// Checking for same folder name

        if (status_code  ==  "409")

       {

            context_info = resp_obj.getJSON("context_info");

            conflict_ids = context_info.getJSON("conflicts").toJSONList();

            for each entry in conflict_ids

            {

                quote_folder_id = entry.getJSON("id");

            }

       }

// Returns the folder ID if these conditions satisfy

        else if ((status_code  ==  "201")  ||  (status_code  ==  "200"))

        {

            quote_folder_id = resp_obj.getJSON("id");

        }

           if (quote_folder_id  ==  "")

        {

            return;

        }

//Get the record name if folder ID exists

        first_name = quote_info.get("Subject");

tokenObj1 = map();

tokenObj1.put("folder_name", first_name);

tokenObj1.put("parent", quote_folder_id);

 

// Update the folder id and record name using API

 

createFlrResp1 = zoho.crm.invokeConnector
                  ("box.box.createboxfolder", tokenObj1, true);

status_code1 = createFlrResp1.get("status_code");

resp_obj1 = createFlrResp1.get("response");

rec_folder_id = "";

  if (status_code1  ==  "409")

  {

            context_info1 = resp_obj1.getJSON("context_info");

            conflict_ids1 = context_info1.getJSON("conflicts").toJSONList();

            for each entry1 in conflict_ids1

            {

                rec_folder_id = entry1.getJSON("id");

            }

          }

        else if ((status_code1  ==  "201")  ||  (status_code1  ==  "200"))

        {

            rec_folder_id = resp_obj1.getJSON("id");

        }

        if (rec_folder_id  !=  "")

            {

            updateMap = map();

            updateMap.put("Box Folder ID", rec_folder_id);

// Update the Box folder ID using the CRM API

            update_resp = zoho.crm.updateRecord
                          ("Quotes", quote_id + "", updateMap);

             }

        return;

    }		
Related List For Quotes Module :

// Note: the custom function should have "record_id" parameter

// Getting record info from Leads or Quotes using the record_id

    quote_info = zoho.crm.getRecordById("Quotes", quote_id.toLong());

    box_folder_id = quote_info.get("Box Folder ID");

 

// satisfies the below conditions if folder id is empty
if ((box_folder_id  ==  null)  ||  (box_folder_id  ==  ""))

    {

        rootFolderId = zoho.crm.getOrgVariable("box.box_rootfolder_id");

        if ((rootFolderId  ==  "")  ||  (rootFolderId  ==  "none"))

        {

            xmlList = ("Folder for Zoho CRM is not created yet in Box. 
If you are an administrator, please go to Box Settings tab and create
a Root Folder.
And, if you are not an administrator please contact your administrator."); return xmlList; } // Creates the folder name as module name under
      the root folder if folder id exists

        tokenObj = map();

        tokenObj.put("folder_name", "Quotes");

        tokenObj.put("parent", rootFolderId);

        createFlrResp = zoho.crm.invokeConnector
                        ("box.box.createboxfolder", tokenObj, true);

        if (createFlrResp  ==  null)

        {

            xmlList = "Please authorize Box to view Box Files. 
                       You can authorize Box in Box Settings tab.";

            return xmlList;

        }

        status_code = createFlrResp.get("status_code");

        quote_folder_id = "";

        resp_obj = createFlrResp.get("response");

//Satisfies the below condition when the folder name comes same

        if (status_code  ==  "409")

        {

            context_info = resp_obj.getJSON("context_info");

            conflict_ids = context_info.getJSON("conflicts").toJSONList();

            for each entry in conflict_ids

            {

                quote_folder_id = entry.getJSON("id");

            }

        }

        else if ((status_code  ==  "201")  ||  (status_code  ==  "200"))

        {

            quote_folder_id = resp_obj.getJSON("id");

        }

        if (quote_folder_id  ==  "")
         {

            xmlList = ("No files exists for this record.");

            return xmlList;

        }

//get the record name and folder id from quote_info

        first_name = quote_info.get("Subject");

        tokenObj1 = map();

        tokenObj1.put("folder_name", first_name);

        tokenObj1.put("parent", quote_folder_id);

        createFlrResp1 = zoho.crm.invokeConnector
                        ("box.box.createboxfolder", tokenObj1, true);

        status_code1 = createFlrResp1.get("status_code");

        resp_obj1 = createFlrResp1.get("response");

        rec_folder_id = "";

        if (status_code1  ==  "409")

        {

            context_info1 = resp_obj1.getJSON("context_info");

            conflict_ids1 = context_info1.getJSON("conflicts").toJSONList();

            for each entry1 in conflict_ids1

            {

                rec_folder_id = entry1.getJSON("id");

            }

        }

        else if ((status_code1  ==  "201")  ||  (status_code1  ==  "200"))

        {

            rec_folder_id = resp_obj1.getJSON("id");

        }

//Update the folder id using the crm API

        if (rec_folder_id  !=  "")

        {

            updateMap = map();

            updateMap.put("Box Folder ID", rec_folder_id);

            update_resp = zoho.crm.updateRecord
                        ("Quotes", quote_id + "", updateMap);

        }

        xmlList = ("No files exists for this record.");

        return xmlList;

    }


    else

    {
  	 tokenMap = map();

        tokenMap.put("FOLDER_ID", box_folder_id);

        tokenMap.put("limit", 100);

        tokenMap.put("offset", 0);

//get the folder items created under the root folder using the token object

        folder_items_map = zoho.crm.invokeConnector
                        (("box.box.getfolderitems"), tokenMap, true);

        folder_items_status = folder_items_map.get("status_code");

        if (folder_items_status  ==  "200")

        {

            listfolder_resp = folder_items_map.get("response");

            entries = listfolder_resp.getJSON("entries");

            entries_list = entries.toJSONList();

            if (
               (entries_list.toString() == null) || (entries_list.size() == 0)
               )
            {

                xmlList = ("No files exists for this record.");

                return xmlList;

            }

//Get the json object items from the entries list

            else

            {

                i = 0;

                recordsXmlStr = "";

                for each entry in entries_list

                {

                    type = entry.getJSON("type");

                    name = entry.getJSON("name");

                    id = entry.getJSON("id");

                    description = "";

                    if (toString(entry).indexOf("description")  >  0)

                    {

                        description = entry.getJSON("description");

                    }

                    if ((description  ==  null)  ||  (description  ==  ""))

                    {

                        description = "--";

                    }

                    size = "";

                    if (toString(entry).indexOf(("size"))  >  0)

                    {

                        size = entry.getJSON(("size"));

                    }

                    if (
                   ((size  ==  null) || (size  ==  "null")) || (size  ==  ""))

                    {

                        size = "0";

                    }

                    content_modified_at = "";

                    if (toString(entry).indexOf("content_modified_at")  >  0)

                    {

                        content_modified_at = entry.getJSON
                                             ("content_modified_at");

                    }

                    if (content_modified_at  ==  null)

                    {

                        content_modified_at = "";

                    }

                    modified_by = "";

                    if (toString(entry).indexOf("modified_by")  >  0)

                    {

                        modified_by = 
                              entry.getJSON("modified_by").getJSON("name");

                    }

                    if (
                        ((modified_by == null) || (modified_by  ==  "")) || 
                              (modified_by == "null")
                       )

                    {

                        modified_by = "--";

                    }

                    shared_link = "";

                    if (toString(entry).indexOf("shared_link")  >  0)

                    {

                        shared_link = entry.getJSON("shared_link");

                    }

                    shared_link_url = "--";

                    if (
                        ((shared_link == null) || (shared_link == "null")) 
                        || (shared_link  ==  "")
                       )

                    {

                        shared_link_url = "--";

                    }

                    else

                    {

                        shared_link_url = shared_link.getJSON("url");

                    }
                     link = "https://app.box.com/files/0/f/" 
                              + box_folder_id + "/1/f_" + id;
                    if (type  ==  "folder")

                    {

                        link = "https://app.box.com/files/0/f/" + id + "/";

                        type = "Folder";

                    }

                    else

                    {

                        type = "File";

                    }

                    if (content_modified_at  !=  "")

                    {

                        content_modified_at = content_modified_at.replaceAll
                                                    ("T"," ");

                    }

                    size_str = "-";

                    size_str = ((((size).toDecimal()  /  1024))) + "";

                    if (size_str.indexOf(".")  >  0)

                    {

                        pos = (size_str.indexOf(".")  +  3);

                        if (pos  >  size_str.length())

                        {

                            pos = size_str.length();

                        }

                        size_str = size_str.subString(0,pos);

                    }

                    size_str = (size_str) + " KB";

//Construct the xml using the above responses

               recordsXmlStr = recordsXmlStr + "";

               recordsXmlStr = recordsXmlStr + "";

               recordsXmlStr = recordsXmlStr + "" + type + "";

               recordsXmlStr = recordsXmlStr + "" + description + "";

               recordsXmlStr = (recordsXmlStr + "" + size_str) + "";

               recordsXmlStr = recordsXmlStr + "" + content_modified_at + "";

               recordsXmlStr = recordsXmlStr + "";

                    if (shared_link_url  ==  "--")

                    {

                        recordsXmlStr = recordsXmlStr + "--";

                    }

                    else

                    {

                        recordsXmlStr = recordsXmlStr + "Shared Link";

                    }

                    recordsXmlStr = recordsXmlStr + "";

                }

                recordsXmlStr = recordsXmlStr + "";

                return recordsXmlStr;

            }

        }

        else if (
            (folder_items_status == "401") || (folder_items_status == "404")
                )

        {

            xmlList = ("You need to be invited to the Box root folder.
Please contact your administrator to get access to content
            already linked to this record.");

            return xmlList;

        }

        else

        {

            xmlList = ("Unable to get files related to this record from Box.");

            return xmlList;

        }

    }
    • Sticky Posts

    • Introducing Kanban Board Extension for Zoho CRM

      Zoho CRM has been helping you with your business in many ways. The foundation of it all is that it is keeping all your data well organized and maintained. It makes work easier for you but what if that was not all.  Yes! That is not all; we now provide the Kanban Board extension that provides a visual management for your CRM data. It is a great way to view all the records segregated the way you want to see them. Be it based on deal status, lead pipeline stage, or campaign type or any other pick list
    • Here's what you can do with your DocuSign Extension

      Contracts, agreements, and other documents have always been an integral, concluding part of any sales process. With the free DocuSign Extension for Zoho CRM, we've made certain that your signing process is entirely digital, and there is no need for copies,
    • Contact Info Extractor Chrome plugin

      Just trying out the Contact Info Extractor plugin and had a quick observation.  Since a target website for this plugin would be LinkedIn, I'm very surprised that the plugin cannot determine that if the selected text in question includes... Joe Smith Vice President at ABC Corporation ... the plugin can recognize the name and title but not the company.  I'd assume that the term "at" would give it the needed clue but on several contacts I tried to add, it's just not catching it. Would love to see the
    • Easily send documents from Egnyte to your leads in Zoho CRM

      Understanding your customers and educating them about your product are two sides of the same sales coin. During a sales process, to educate your potentials about your product, you may have to send them user guides, help documents, comparison sheets, and
    • Empower Your Sales Team with Email Marketing Insights Using the Mailchimp Extension

      Email marketing is one of the most powerful tools available for engaging leads. It’s low cost and high ROI makes it a top choice for marketers who want to establish contact with leads. But these leads can only be turned into actionable deals when pursued
    • Recent Topics

    • Getting list of calendar events over api for zoho mail calendar

      Hi, I am using just Zoho mail without using Zoho CRM. I wanted to get all events booked in my zoho mail calendar through an api at regular intervals. I could find such API support for Zoho CRM calendar but not for zoho mail calendar. Can you kindly let
    • Crear tarea CRM con recordatorio desde Zoho Flow

      Hola, estoy intentando crear desde Zoho Flow una tarea en CRM. Lo he logrado hacer pero sin recordatorio, ya que no se como se debe escribir el string adecuado. He probado varias alternativas, pero ninguna me funcionó hasta ahora. - FREQ=NONE;ACTION=EMAIL;TRIGGER=DATE-TIME:${FechaVto}
    • Recurring Bookings

      Will Zoho Bookings ever offer an option to the customer to schedule recurring meetings (unlimited) for the same days/times? Making a client schedule the same days/times for an entire month is a tedious process. I'd like to offer the option upfront to
    • Zoho CRM's new Homepage component: See all your activities in one powerful view!

      Hello everyone, We’re excited to introduce a new feature to your CRM dashboards: the Homepage Open Activity Component! Now you can effortlessly track all your open activities—including tasks, meetings, calls, and appointments—in a unified view, tailored
    • No fue posible enviar el mensaje;Motivo:553 Relaying disallowed. Invalid Domain - admin@laboratoriosantarosa.org

      Hola Renovamos después del tiempo el dominio, y luego de eso se cayó el servicio de correo. Seguimos las indicaciones que se indican en este articulo, sin embargo, hasta el momento solo podemos recibir correos pero no enviar. Hemos actualizado los registros
    • Add an option to start zobot when user clicks the Chat with Us button

      I would like to have an option to start the zobot when user clicks on "Chat with us" button when chat widget is maximized
    • Ticket list sorting is now supported in the latest version of the Desk Android mobile app.

      Hello, In the latest version of the Desk Android mobile app (v2.4.32), we have brought in the option to sort the ticket listing view.   Now we can sort the tickets listing by Ticket Id, Due Date, Recent Thread and Created Time. Please update the app either
    • Mass delete leads

      How do I mass delete leads in ZMA? I want to delete leads that have not opened emails in 6 months. But I can only select 200 at a time - there are thousands.
    • Creator v5, v6 and v8 for Zoho One

      Greetings, I hope find all doing well and safe. I was browsing the Zoho One page, where the details of each application's plans are outlined (https://www.zoho.com/one/plan-details.html?prd=zcreator). I noticed there are three versions available for Creator
    • Base Currency Adjustment - Mark Transaction as Something Other than Unreconciled

      Not a very concise title, but it describes the issue pretty well. Basically, when a Base Currency Adjustment is made, the transaction is recorded in the register of the account in question (as it should be). It's marked as "Manually Added", which makes
    • Customer Account Statement

      Dear Sir, I am Travel Agent Curranty Zoho Provide Customer Statement with Date, Transactions, Details, Amount, Payments, Balance Our Suggestion is kindly Provide Statement with Item name & Description Kindly find the attachment
    • move or clone the custom layout

      Hi, is it possible to move or clone the custom layout of a ticket from one department to another? BR
    • How to restart the timer for the 'First Response' field associated with an SLA.

      Hello, through the API, I send an email to multiple accounts when a new ticket is created, and the system automatically sets the "First Response" field to null. I would like this to happen only when a ticket is assigned.
    • Invoice filter issue

      Hello Team, I am using following API documentation for getting list of invoices. https://www.zoho.com/books/api/v3/invoices/#list-invoices I have applied filter on multiple fields & its working correctly. But when I pass search_text parameter with combination
    • Zoho Books says "Please ensure that the "webhook_name" has less than 50 characters."

      I have a custom module on Zoho Books that creates a customer trip record. It has a customer field to link to their account information. When these entries are created, I want to fetch this customer's information so I can put the selected customer's address
    • Automatic Portal invite

      We have numerous customers we move through a blueprint in deals, when they get to a certain point we need to give them portal access, how can this be done through deluge or a workflow?
    • How to delay automatic retainer invoice

      Hi, we would like to use the functionality that there is a retainer invoice created automaticaly, when the customer accepts the offer. The "problem" is that the mail with the retainer invoice is sent imediatelly to the customer, which is kind of "impolite".
    • Refresh token not appearing

      Hello, I was wondering if there is another way of obtaining a refresh token, as following the usual 60-second-code procedure generates a new access token, but not the refresh token, and so i have to repeat everything to get a new token every hour or so,
    • Quote item header via api

      Hello. I'm not a programmer, but am trying as an amateur to have a form create a new quote so I can guide my sales reps with questions to accurately fill out the quote. We use zoho books. After three days I've successfully been able to create a quote
    • Decrypting Secrets Returned by Zoho Vault API

      Hello, I've been able to follow the documentation here: Zoho Vault | API Reference and successfully call the GET_LOGIN operation with my token. I get back a response containing/similar to this: "name": "GET_LOGIN", "details": { "PASSPHRASE": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxABCDEFG==",
    • copy the row to the end of table if under condition

      Hi, my table is created from zoho forms entry. Lat's say that column 3 has value 1 or 2. when the value is 1, no action is needed but when the value is 2 I would like that entire raw was automatically copied to the next row - it is the end of the table.
    • my seo title , keyword and discription are not reflecting

      I added seo title, description, and keyword on my products but they are not reflecting. Please resove this problem.
    • Integrate WhatsApp and ZohoOne

      What is the most recommended application or tool to integrate WhatsApp and ZohoOne? That allows, for example: - When a new lead is generated in Zoho CRM, the lead automatically receives a message by WhatsApp. - In line with the previous point, schedule
    • Allow Zoho Cliq Admins to Manage External Channels Without Joining

      Dear Zoho Team, Greetings! As a Cliq admin, I can create external channels, but there is currently no way for me to invite external users to these channels without being a part of them. There are scenarios where, as an admin, I only need to set up the
    • Invite External Users to Channels via Zoho Cliq Mobile App

      Dear Zoho Team, Greetings! Currently, Zoho Cliq allows us to invite external users to an external channel through the web interface. However, this functionality is not available in the mobile app. We kindly request the addition of this feature to the
    • Deluge help - Looping in Zoho CRM

      Hi! I am trying to create a function and struggling as I cannot get the function to repeat without. breaking. Trying to write a function (currently doing through schedule) to run daily. Searching for tasks that are 90 days or more overdue. If task is
    • Community Digest Noviembre 2024 - Todas las novedades en Español Zoho Community

      ¡Hola, Español Zoho Community! Wow, ya termina el año, ¡gracias a vuestra participación se nos ha pasado volando! Por eso mismo estamos preparando sorpresas para todos los que participáis en la Español Zoho Community para el próximo año, ¡estad atentos
    • Assistance Required: Email Authentication Issue (SPF/DKIM) for Domain clearskyaerials.net

      Dear Support Team, I hope this email finds you well. I am experiencing an issue with my email services after linking my domain clearskyaerials.net (hosted on Zoho) to WordPress for website building. I am unable to send or receive emails, and the following
    • ZOHO MAIL not loading

      Hello, My zoho mail is not loading. Both my desktop version and in google chrome. It opens but then doesn't load any charts. Are there any issues and how fast will it be resolved? Rafal.
    • Zoho Storage Limit in Account where Multiple Emails are Accessed

      I have a main email account but also access three other email accounts set up in Zoho regularly so I set them up under my main account. Each account should have its own storage. However, I recently got a notification that my email was reaching its storage
    • Not Getting Emails

      I am not getting any emails. All DNS is correct. I have been waiting for over an hour for my test email from my personal Gmail account to arrive into my Zoho Mail.
    • Unable to receive emails from WordPress website contact forms.

      MX records are set up correctly, and email routing is set to remote. I am using WPForms on my website, which has been configured to send notifications to my Zoho mail. When I configure the notifications to my gmail account it works perfectly but I want
    • Zoho Support is Dysfunctional & Don't Know Their Own Support Hours

      Seeking clarification on Zoho support hours and contact numbers please. We have been trying to phone Zoho support on +61 2 8066 2898 at 9:20am AEDT for the second day in a row, and gotten a message on Zoho's support line: "support is open monday through
    • Not receiving emails; sending fine

      I got my last email at 5:09 MST this morning, but I'm not receiving any right now. I've made no changes to my MX records recently, and when I check them, they point to Zoho mail.
    • Unable to parse JSON field in New Query Table

      I have a multiple level JSON field which I am unable to parse. "Complete Blocks"."EVENT_SCORES_JSON":"OverallScore" as Score The above line returns the full "Complete Blocks"."EVENT_SCORES_JSON" field as a Text type field i.e { "OverallScore" : XX, ect...
    • Can Send Emails But I am not Receiving emails in Zoho Account

      I have set everything up and have the MX records pointing only to Zoho, nothing else. I am NOT reciving any error message when I send an email to the ZOHO email address but there is nothing in my Zoho Inbox. Please look into this and tell me what I need
    • Canvas List View Not Saving

      Hi, I am trying to edit a list view to look different depending on the tags. Everything worked well and saved well with multiple views, but when I have gone back in to make some small changes like moving one of the icons it comes up with the error message
    • tidak dapt menerima email

      saya menggunakan email zoho gratis melalui DNS RUMAH HOSTING, semua instruksi MX, DKIM, dll saya sudh ikuti sesuai petunjuk,,,namadomain saya poyakumsahira.org , mohon bantuannya
    • How to lookup What_id to create a task in Zoho CRM?

      I'm trying to create a task in Zoho CRM by creating a new module entry. I'm getting an error: "Zoho CRM says 'required field not found'. Check the input for What_Id and try again." I'm assuming the What_Id is the "Subject" in the create entry task. I
    • Generate a Zoho Sign link

      From time to time I get a response "I never received your you e-document for electronic signature" is there a way to generate a Zoho Sign link to share.
    • Next Page