Overview & Purpose
This guide explains how to configure Lookup Relationship fields across Zoho CRM modules used by the 360 SMS App, and how to create a Workflow Automation using a Deluge function. Once configured, SMS Message History records sent or received via a child module (e.g., Contacts) will automatically be linked to the parent module (e.g., Accounts), enabling a unified conversation view at the account level.
Use Case – A CSM wants to see all SMS conversations from multiple Contacts belonging to the same Account on that Account record — without navigating to each Contact individually.
Prerequisites
- Administrative access to Zoho CRM (Settings > Setup).
- 360 SMS App installed and active in the Zoho CRM organisation.
- The Message History module (
CustomModule6) is present in the CRM. - The target parent module (e.g., Accounts) exists in the CRM.
- The child module (e.g., Contacts) has a lookup field pointing to the parent module (e.g.,
Account_Name→ Accounts). Note the API name of this field. - Access to Automation > Workflow Rules in Zoho CRM.
Architecture: How It Works
The configuration works in two complementary parts:
| Part A | Add a Lookup field (pointing to the parent module, e.g., Accounts) to the layout of each 360 SMS custom module where cross-module visibility is required (Message History, Message Compliance, Schedule Messages). |
|---|---|
| Part B | Create a Workflow Rule on the Message History module that fires on record creation. It checks whether the child lookup (e.g., Contacts) is populated, then calls a Deluge function that fetches the parent ID and writes it into the Accounts lookup on the Message History record. |
| Result | Once a message is sent via a Contact, its Message History record is automatically linked to the parent Account — so the Account’s related list shows the full SMS history across all linked contacts. |
Part A: Add Lookup Fields to Module Layouts
You must add a Lookup field pointing to the parent module (e.g., Accounts) inside each 360 SMS custom module layout where Message History sharing is required. Repeat this process for every module you need to cover.
Step 1: Navigate to Modules and Fields
- From the Zoho CRM top navigation, click the Settings (gear) icon, then select Setup.
- In the left sidebar, navigate to Customization > Modules and Fields.
- The Modules list appears. Locate the module you want to configure first (e.g., Message History).
Step 2: Add Lookup Field to the Message History Module
- Click on Message History in the module list to open its settings.
- Click the Layouts tab, then click on the Standard layout to open the layout editor.
- In the left panel, locate the Lookup field type.
- Drag the Lookup field from the left panel and drop it into the layout canvas (right-hand column recommended).
- A Lookup Properties dialog will appear. Fill in the fields below:
| Field / Setting | Value / Action |
|---|---|
| Field Label | Display name for this field, e.g., Accounts |
| Lookup Module | Select the parent module from the dropdown, e.g., Accounts |
| Related List Title | The label that appears as a related list on the parent record, e.g., Message History. This controls how linked records appear when viewing the Account. |
| Mark as Public | Optional — check only if portal visibility is needed. |
| Required | Leave unchecked unless a mandatory entry is required. |
- Click Done to close the dialog. The new field appears on the layout.
- Click Save and Close (top right). A green Updated successfully notification confirms the save.
Note – If a Lookup field pointing to Accounts already exists on the Message History layout, do not add a new one. Just verify the API name of the existing field — you will need it in the Deluge function.
Step 3: Add Lookup Field to Other Target Modules
Repeat the same process for any additional 360 SMS modules where SMS history should be visible on the parent record. Commonly configured modules:
| Module | Default Module Name | Recommended Related List Title |
|---|---|---|
| Message History | CustomModule6 |
Message History |
| Message Compliance | CustomModule10 |
Message Compliance |
| Schedule Messages | CustomModule2 |
Schedule Messages |
| Transaction Logs | CustomModule1 |
Transaction Logs |
For each module: open its Standard Layout, drag in a Lookup field, set Lookup Module = Accounts, fill in the Related List Title, click Done, then Save and Close.
Note – The Workflow Rule in Part B is written for the Message History module. For other modules (e.g., Message Compliance, Schedule Messages) you will need separate workflow rules following the same pattern.
Part B: Create the Workflow Rule
This workflow rule fires whenever a new Message History record is created where the child module lookup (e.g., Contacts) is populated. It calls a Deluge function that looks up the parent ID from the child record and stamps it onto the Accounts lookup in the Message History record.
Step 4: Navigate to Workflow Rules
- Go to Settings > Setup.
- In the left sidebar, expand Automation and click Workflow Rules.
- Click Create Rule (top right of the Workflow Rules list).
Step 5: Create the Workflow Rule
The Create New Rule dialog appears. Configure it as follows:
| Field / Setting | Value / Action |
|---|---|
| Module | Select Message History from the dropdown. |
| Rule Name | Enter a descriptive name, e.g., Update Parent in Child. |
| Description | Optional. Enter a brief description for future reference. |
- Click Next to proceed to the rule canvas.
Step 6: Set the Trigger and Condition
On the rule canvas, the WHEN block prompts you to set the trigger:
| Field / Setting | Value / Action |
|---|---|
| Execute On | Select Create — fires when a new Message History record is created. |
| Applies To | Select Message History matching certain conditions. |
Click the CONDITION block and add the following condition:
| Field / Setting | Value / Action |
|---|---|
| Field | Contacts — the lookup field in Message History pointing to the Contacts module. |
| Operator | IS NOT EMPTY |
- Click Done to save the condition.
Note – This condition ensures the rule only runs when the Message History record is linked to a Contact. For a different child module (e.g., Leads), replace the Contacts field with the corresponding lookup field in Message History.
Step 7: Create and Configure the Deluge Function
- In the Instant Actions block on the workflow canvas, click + Action and select Function.
- A panel will appear. Click + Add New Function / Write your own.
- A Create Function dialog will appear:
| Field / Setting | Value / Action |
|---|---|
| Display Name | Enter a name, e.g., update_parent |
| Function Name | Auto-populated from Display Name. This becomes the API name. |
| Description | Optional. |
- Click Create. The Deluge function editor opens.
- Replace the default boilerplate with the following code. The function must declare the two parameters shown:
void automation.Update_Parent(Int child_id, Int rec_id)
{
get_rec = zoho.crm.getRecordById("Contacts", child_id);
parent_id = get_rec.getJSON("Account_Name").getJSON("id");
update_map = Map();
update_map.put("Accounts", parent_id);
update_rec = zoho.crm.updateRecord(
"dc360__Message_History",
rec_id,
update_map);
info update_rec;
}
Key values to customise for your environment:
| Value in Sample Code | What It Represents | How to Customise |
|---|---|---|
"Contacts" |
API name of the child module | Replace with your child module API name, e.g., Leads |
"Account_Name" |
API name of the parent lookup in the child | Replace with the field that links the child to the parent module |
"Accounts" |
API name of the lookup added in Part A | Must match the Lookup field added to Message History in Step 2 |
"dc360__Message_History" |
API name of the Message History module | Standard 360 SMS API name — do not change unless customised |
child_id |
ID of the child record (e.g., Contact) | Mapped via Argument Mapping in Step 8 |
rec_id |
ID of the Message History record | Mapped via Argument Mapping in Step 8 |
Important – Do NOT click Save or Save and Associate yet. Complete the Argument Mapping in Step 8 first.
Step 8: Map Function Arguments
After entering the code, look at the Arguments panel on the right side of the function editor. Two arguments are listed — child_id and rec_id — each showing Not yet assigned.
- Click the edit (pencil) icon next to Arguments to open the Argument Mapping dialog.
Map child_id:
| Field / Setting | Value / Action |
|---|---|
child_id |
Click the value field and select Lookup:Contacts > Contact Id from the dropdown. This maps the Contacts lookup ID to the child_id parameter. |
Map rec_id:
| Field / Setting | Value / Action |
|---|---|
rec_id |
Click the value field and type # to open the Add Merge Field dialog. Select Message History as the module, then choose Message History Id. Click Done. The value will show as: Message History – Message History Id. |
Once both arguments are mapped, click Done to close the dialog. Verify the Arguments panel shows:
| Argument | Mapped Value |
|---|---|
child_id |
Lookup:Contacts — Contact Id |
rec_id |
Message History — Message History Id |
- Click Save and Associate (top right of the function editor) to save the function and link it to the workflow rule.
Note – If your child module is Leads instead of Contacts, map child_id to Lookup:Leads — Lead Id.
Step 9: Save and Activate the Workflow Rule
After saving the function, you are returned to the workflow canvas. Verify the rule summary shows:
| Block | Expected Value |
|---|---|
| WHEN | This rule will be executed when a message history is created. |
| CONDITION 1 | Contacts IS NOT EMPTY |
| Instant Action | Function → [your function name, e.g., update_parent] |
- Click Save at the bottom of the canvas. The rule is now active.
Note – To temporarily disable the rule without deleting it, use the Deactivate button on the Workflow Rule detail page.
Part C: Verification
Step 10: Test the Configuration End-to-End
Scenario 1 — Existing Contact:
- Navigate to a Contact record that is already linked to a parent Account.
- Send an SMS or WhatsApp message from that Contact using the 360 SMS Conversation View.
- Navigate to the parent Account record.
- Scroll to the Message History related list. The message should now appear there with the Contact as the Related Record.
Scenario 2 — New Contact:
- Create a new Contact and assign it to an existing Account (fill in the Account Name field).
- Send a message from the new Contact.
- Open the parent Account and confirm the new Contact’s message appears in the Account’s Message History related list.
Expected Result – The Account’s Message History related list and Conversation View aggregate messages from all linked Contacts, providing a unified SMS view at the account level.
Note – If messages are not appearing:
- Confirm the Workflow Rule is Active.
- Check the Contact record has the Account Name field populated.
- Verify the Accounts Lookup field was saved on the Message History layout (Step 2).
- Confirm function arguments are correctly mapped (Step 8).
Code Reference
The following is the complete annotated Deluge function. This sample uses Contacts as the child module and Accounts as the parent. Adapt the values listed in the Step 7 customisation table for other parent-child relationships.
Function: update_parent
/**
* Function : Update_Parent
* Purpose : Fetches the parent ID from the child record and writes
* it into the parent lookup on the Message History record.
*
* Parameters:
* child_id (Int) - ID of the child record (e.g., Contact ID)
* rec_id (Int) - ID of the Message History record
*
* Customise for your environment:
* "Contacts" - API name of the child module
* "Account_Name" - API name of the parent lookup in the child
* "Accounts" - API name of the parent lookup in Msg History
* "dc360__Message_History" - API name of the Message History module
*/
void automation.Update_Parent(Int child_id, Int rec_id)
{
// Step 1: Fetch the child record by ID
get_rec = zoho.crm.getRecordById("Contacts", child_id);
// Step 2: Extract the parent record ID from the child
parent_id = get_rec.getJSON("Account_Name").getJSON("id");
// Step 3: Build the update map with the parent lookup field
update_map = Map();
update_map.put("Accounts", parent_id);
// Step 4: Update the Message History record with the parent ID
update_rec = zoho.crm.updateRecord(
"dc360__Message_History",
rec_id,
update_map);
// Step 5: Log the result for debugging
info update_rec;
}
Adapting for a Different Parent-Child Relationship
To apply the same pattern for a different child module (e.g., Leads linked to Accounts), update these three values:
| Original Value | Replace With | Why |
|---|---|---|
"Contacts" |
API name of your child module, e.g., "Leads" |
The module whose record is the child in the relationship |
"Account_Name" |
API name of the parent field in the child, e.g., "Account_Name" for Leads |
The field on the child that stores the parent ID |
"Accounts" |
API name of the lookup in Message History (usually unchanged) | Must match the Lookup field added in Part A, Step 2 |
Troubleshooting
| Issue | Likely Cause | Resolution |
|---|---|---|
| Messages not appearing on the Account’s related list | Workflow rule inactive, or Contacts field not populated on Message History | 1. Confirm rule is Active. 2. Open a Message History record and check the Contacts lookup is filled. 3. Verify the Accounts lookup field exists on the layout. |
| Function error in the execution log | Incorrect API names in the Deluge code | Check the execution log. Compare API names in the code with actual module/field API names in Zoho CRM. |
| ‘Not yet assigned’ for function arguments | Argument mapping was not completed | Re-open the workflow rule, edit the function, and complete argument mapping as in Step 8. |
| Lookup field not visible on the record | Layout was not saved after adding the field | Re-open the Standard layout and confirm the Accounts Lookup field is present. Click Save and Close. |
| Related list missing on the Account | Related List Title was blank or layout not saved | Re-open Lookup Properties for the field. Ensure Related List Title is filled. Save the layout. |
| Workflow fires but parent_id is null | Contact does not have Account Name populated | Ensure the Contact record has the Account Name field filled before the message is sent. |
Quick Reference Checklist
Use this checklist to track completion of each configuration step.
Part A: Module Layout Configuration
- Navigate to Setup > Customization > Modules and Fields
- Open Message History > Layouts > Standard
- Drag Lookup field onto layout; set Field Label = Accounts, Lookup Module = Accounts, Related List Title = Message History
- Click Done, then Save and Close
- Repeat for Message Compliance (Related List Title = Message Compliance)
- Repeat for Schedule Messages (Related List Title = Schedule Messages)
- Repeat for any other module required
Part B: Workflow Automation
- Navigate to Setup > Automation > Workflow Rules
- Click Create Rule; select Message History; name the rule
- Set trigger to Create
- Add condition: Contacts IS NOT EMPTY, click Done
- Add Instant Action: Function > Create new function; enter Display Name
- Enter Deluge code with parameters
child_idandrec_id - Map
child_id= Lookup:Contacts – Contact Id - Map
rec_id= Message History – Message History Id (use # merge field) - Click Save and Associate
- Click Save on the workflow rule canvas
Part C: Verification
- Send a message from an existing Contact linked to an Account
- Open the parent Account and verify Message History related list is populated
- Create a new Contact linked to the same Account; send a message
- Verify the new message appears on the Account’s Message History
For questions or support, contact the 360 support team.