SMS History Related List

Leads and Contacts modules in Zoho are pre-configured to display the SMS History detail view by default for individual records. For all other modules you need to manually create a function to view the SMS History details. This function can be added to the record detail page through the Related List button.
Follow these steps to create a SMS History View through the Related list button:

Step 1: Create a Function

  1. In Zoho CRM, click . The Setup page appears.
  2. Under Developer Space, click Functions. The Functions page appears.
  3. Click Create New Functions.The Create Function pop-up window appears.
  4. Under Choose a place, click the drop-down list to select Related List.
  5. Click Next.The Create Function pop-up window appears as shown.
  6. Do the following:
    • Type a name for the function within the text area labeled Untitled_Function.
    • In the text area under the Edit Arguments paste the following code:
      myFieldMap = Map();
      
      myFieldMap.put("module","smsmagic4.SMS_History");
      
      myFieldMap.put("criteria","smsmagic4__MobileNumber:equals:" + phone_field);
      
      response = zoho.crm.invokeConnector("crm.search",myFieldMap);
      
      sms_record = response.get("response").get("data");
      
      rowCount = 1;
      
      if(sms_record != null)
      
      {
      
       info "Got record";
      
       responseXML = "";
      
       for each  record in sms_record
      
       {
      
               responseXML = responseXML + "";
      
               //                 responseXML = responseXML + "" + record.get("id") + "";
      
               responseXML = responseXML + "" + record.get("smsmagic4.CustomModule1_Name") + "";
      
               responseXML = responseXML + "" + record.get("smsmagic4.MobileNumber") + "";
      
               responseXML = responseXML + "" + record.get("smsmagic4.Direction") + "";
      
               responseXML = responseXML + "" + record.get("smsmagic4.Status") + "";
      
               responseXML = responseXML + "" + record.get("smsmagic4.Text") + "";
      
               responseXML = responseXML + "";
      
               rowCount = rowCount + 1;
      
       }
      
       responseXML = responseXML + "";
      
      }
      
      else
      
      {
      
       info "no record ";
      
       responseXML = "No Record Found";
      
      }
      
      return responseXML;

      Prior to copying the function in the text area, remove the default code text ” Return ” “; ” displayed. If not removed, you will receive an error and the function will not be saved properly.

  7. Click Edit Arguments. The Edit Arguments pop-up window appears.
  8. Do the following to edit the Arguments:
    • Type a name for the function.
    • Under the Function Arguments, add the argument name as phone_field (Do NOT change the value shown and include it as shown)
    • Click the Select Type drop-down to choose string as the argument type.
    • Click Save.
  9. Under Create Function, click Save. The Function is updated and appears under the My Function list.


Step 2: Add Function as Related List

  1. From the top menu bar, select a module where you want to add the related list. The Module page appears.
  2. Click a record and scroll to the end of the page.
  3. Click Add Related List. The Add Related List pop-up window appears.
  4. Click Functions. The Functions pop-up window appears displaying the list of available functions.
  5. Click the Function you want to select. The Configure Functions pop-up window appears.
  6. Under Argument Mapping, select the argument name and value. For example, phone_field, phone.
  7. Click Save. The Create Custom Related List pop-up window appears.
  8. Type a name for the Related list.
  9. Click Save.The SMS History record related to the selected record appears.

Was This Article Helpful?

0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *

xTo test this chatbot, please submit your details on this page
Note: After submitting your details you will be redirected to this page and access chatbot