Extension Pointers JS SDK Series #3: Delinking a related record in a Zoho CRM module from a widget

Extension Pointers JS SDK Series #3: Delinking a related record in a Zoho CRM module from a widget

In synchronization, it is important to be able to associate and dissociate the required data at the appropriate times. In our previous post, we mentioned the method to fetch related records in a Zoho CRM module from a widget. In this post, we will explain the process of delinking a related record for a Zoho CRM module from a widget, which is the reverse process to the previous post. Associating data between modules and establishing related records in your Zoho CRM is a common action, but you may sometimes no longer require the information from a particular related record. Instead of completely deleting the unnecessary related records from your Zoho CRM, you can perform a simple delinking process, and still retain the details in Zoho CRM. 

ZOHO.CRM.API.delinkRelatedRecord(config) is used to delink a record from its related list record details.

Syntax:

ZOHO.CRM.API.delinkRelatedRecord(config)

Here config is the configuration object constructed with the following details:

Configuration Object

Name
Type
Description
Entity
String
API Name of the module.
RecordID
String
RecordID of the entity whose associated details are required.
RelatedListName
String
API Name of the relatedList of the entity.
RelatedRecordID
String
Related Record ID.

Example

ZOHO.CRM.API.delinkRelatedRecord({Entity:"Contacts",RecordID:"43426879776433",RelatedList:"Deals",RelatedRecordID:"7678567456858"})
.then(function(data){
console.log(data)
})


Here, the Deal (related list for the Contact module) with deal ID "7678567456858" is associated with the Contact with the recordID "43426879776433". In the above example, the deal's record is delinked from the deals associated with the contact using ZOHO.CRM.API.delinkRelatedRecord.

Scenario:

Let's consider a scenario. Your wireless fidelity business, which is a service provider for wireless network connection, uses Zoho CRM. The Contacts module holds business clients who have bought your connection and the Deals module holds deals (connection plan) that are associated with the client along with the deal status.

Let's imagine a situation in which a customer chooses to unsubscribe from their current plan and move to another plan or move to another service provider. Now you decide to delink the related information from the relevant record in the Contacts module without completely deleting the information from your CRM. You can perform this action by delinking the specific deal associated with the contact. Let's see how ZOHO.CRM.API.delinkRelatedRecord helps to achieve this from a widget.

Code Snippet:

Util={};
function initializeWidget()
{
// Event Listener triggered when the entity page is loaded
ZOHO.embeddedApp.on("PageLoad",function(data)
{
//Fetching the entity ID of the current page that is loaded
contactid=data.EntityId;
entityname=data.Entity;  

/*Fetching all the deals that are related with the contact using the getRelatedRecords method. Passing the value of RelatedList as Deals and Entity as Contacts to the getRealtedRecords method.*/  
ZOHO.CRM.API.getRelatedRecords({Entity:"Contacts",RecordID:contactid,RelatedList:"Deals",page:1,per_page:200})
.then(function(data){
temp=data;
rec=data.data;
console.log(data);
$('#dealidlist').empty();
//Looping through the deals
for (i = 0; i < rec.length; i++) 
{
/*Creating a list called dealidlist. Populating the dealidlist with the names of all the deals associated with the contact, when the GetDeals button is clicked*/
dealid=rec[i].id;
dealname=rec[i].Deal_Name;
var dealidlist = document.getElementById("dealidlist");
var option = document.createElement("OPTION");
option.innerHTML = dealname;
option.value = dealid;
dealidlist.appendChild(option);
}
})
//Functionality of Delink deals button
Util.delink=function()
{
/*The deal selected from the dealidlist is passed as RelatedRecordID value, to the delinkRelatedRecord method. Delinking the deal selected from the dealidlist and thereby dissociating it from the contact*/ ZOHO.CRM.API.delinkRelatedRecord({Entity:"Contacts",RecordID:contactid,RelatedList:"Deals",RelatedRecordID:document.getElementById("dealidlist").value})
.then(function(data){
console.log(data)
})
ZOHO.CRM.UI.Popup.close()
.then(function(data){
console.log(data)
})
}; 
//Functionality of the cancel button
Util.cancel=function()
{
//closes the widget window
ZOHO.CRM.UI.Popup.close()
.then(function(data){
console.log(data)
})
};
})
//Initializing the widget
ZOHO.embeddedApp.init();
}

Click the Manage Connections button (available in the contact's detail page) associated with the widget to open the widget screen.



Choose the deal you want to delink from the contact and click Delink Deal. The deal will now be delinked from the customer.



This is an example of how you can use ZOHO.CRM.API.delinkRelatedRecord to delink a related record from a Zoho CRM contact from your widget. You can use this SDK according to your business needs to perform operations efficiently from your widget. We hope you found this information useful. Keep following this space for more tips.

SEE ALSO



    Access your files securely from anywhere



                        Zoho Developer Community




                                              • Desk Community Learning Series


                                              • Digest


                                              • Functions


                                              • Meetups


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner


                                              • Word of the Day


                                              • Ask the Experts





                                                        Manage your brands on social media



                                                              Zoho TeamInbox Resources



                                                                  Zoho CRM Plus Resources

                                                                    Zoho Books Resources


                                                                      Zoho Subscriptions Resources

                                                                        Zoho Projects Resources


                                                                          Zoho Sprints Resources


                                                                            Qntrl Resources


                                                                              Zoho Creator Resources



                                                                                  Zoho CRM Resources

                                                                                  • CRM Community Learning Series

                                                                                    CRM Community Learning Series


                                                                                  • Kaizen

                                                                                    Kaizen

                                                                                  • Functions

                                                                                    Functions

                                                                                  • Meetups

                                                                                    Meetups

                                                                                  • Kbase

                                                                                    Kbase

                                                                                  • Resources

                                                                                    Resources

                                                                                  • Digest

                                                                                    Digest

                                                                                  • CRM Marketplace

                                                                                    CRM Marketplace

                                                                                  • MVP Corner

                                                                                    MVP Corner





                                                                                      Design. Discuss. Deliver.

                                                                                      Create visually engaging stories with Zoho Show.

                                                                                      Get Started Now


                                                                                        Zoho Show Resources


                                                                                          Zoho Writer Writer

                                                                                          Get Started. Write Away!

                                                                                          Writer is a powerful online word processor, designed for collaborative work.

                                                                                            Zoho CRM コンテンツ










                                                                                              Nederlandse Hulpbronnen


                                                                                                  ご検討中の方




                                                                                                        • Recent Topics

                                                                                                        • Sync desktop folders instantly with WorkDrive TrueSync (Beta)

                                                                                                          Keeping your important files backed up and accessible has never been easier! With WorkDrive desktop app (TrueSync), you can now automatically sync specific desktop folders to WorkDrive Web, ensuring seamless, real-time updates across devices. Important:
                                                                                                        • Can't attach

                                                                                                          I am having problems sending attachments. I am trying to attach some PDFs to an email (as I do several times every day) but the progress bar on the attached file gets stuck somewhere between 20%-70% and when I hit send I get the error message 'Attachment
                                                                                                        • WhatsApp Channels in Zoho Campaigns

                                                                                                          Now that Meta has opened WhatsApp Channels globally, will you add it to Zoho Campaigns? It's another top channel for marketing communications as email and SMS. Thanks.
                                                                                                        • Existing subform data is being changed when new subform entries are added

                                                                                                          I'm having trouble with existing subform data being changed when new subform entries are created. I have the following setup to track registrations for a girl scout troop: Main Form: Child Subform: Registrations The data are a one-to-many relationship where each Child record has many Registrations (new Registration will be created for each year the child is in the troop.) Per the instructions, I have created the subfom, added it to the main form, gone back to the subform and created the bi-directional
                                                                                                        • Bigin: filter Contacts by Company fields

                                                                                                          Hello, I was wondering if there's a way to filter the contacts based on a field belonging to their company. I.e.: - filter contacts by Company Annual Revenue field - filter contacts by Company Employee No. field In case this is not possibile, what workaround
                                                                                                        • Button on Deal screen to automate changing deal dates?

                                                                                                          Hi I spend a lot of time working with our accounts managers here moving deals around the calendar, qualifying things etc. I'd like to have an easy way to change the closing date on a deal, from the deal screen table, rather than either click in to the
                                                                                                        • Attention API Users: Upcoming Support for Renaming System Fields

                                                                                                          Hello all! We are excited to announce an upcoming enhancement in Zoho CRM: support for renaming system-defined fields! Current Behavior Currently, system-defined fields returned by the GET - Fields Metadata API have display_label and field_label properties
                                                                                                        • How to authenticate my domain on ovh

                                                                                                          I don't succeed in adding an domain authentification on ovh. Should i first create a subdomain? But this doesn't work either, ti gi ves te same screen and the next button is greyed out when adding the info received from zoho
                                                                                                        • Undelivered Mail Returned to Sender

                                                                                                          commerciale@etruriadesign.it, ERROR CODE :550 - "The mail server detected your message as spam and has prevented delivery." I have been corresponding with the receiver and they wrote "Ciao, ho fatto verificare ma purtroppo non è un problema che deriva
                                                                                                        • Kaizen #190 - Queries in Custom Related Lists

                                                                                                          Hello everyone! Welcome back to another week of Kaizen! This week, we will discuss yet another interesting enhancement to Queries. As you all know, Queries allow you to dynamically retrieve data from CRM as well as third-party services directly within
                                                                                                        • Notifications no longer being sent to my email address for any scheduled events

                                                                                                          The last few weeks, I stopped receiving email notifications to my email for events I have scheduled and have a selected reminder option checked.
                                                                                                        • This domain is not allowed to add. Please contact support-as@zohocorp.com for further details

                                                                                                          I am trying to setup the free version of Zoho Mail. When I tried to add my domain, theselfreunion.com I got the error message that is the subject of this Topic. I've read your other community forum topics, and this is NOT a free domain. So what is the
                                                                                                        • Group to shared mailbox conversion

                                                                                                          Is it possible to convert a group in Zoho mail to a shared mailbox?
                                                                                                        • Mail Merge Stuck in Queue

                                                                                                          I am trying to send Mail Merge's and it never sends out to the full list. It always hits a portion and the rest remain in the "Queue" - the emails I am sending are time sensitive, so I need this to be resolved or have a way to push the emails through
                                                                                                        • why do I get error message each time I open zoho mail

                                                                                                          why do I get error message each time I open zoho mail
                                                                                                        • Cross-department Parent-Child ticketing for faster and efficient ticket resolution

                                                                                                          Hello everyone, Organizations frequently need to have multiple departments set up in their customer service ticketing system. However, when a customer raises an issue or an internal process that requires agents to collaborate with their peers, a lack
                                                                                                        • Can't setup email on outlook (Android Phone)

                                                                                                          Dear All Support, I have tried many time to setup this zoho mail over the android phone (outlook app) . But it's always show me to check username/password of my email . But i can login from the webmail , that's why i confuse , How can i able to access
                                                                                                        • Having problem with MX records and SPF

                                                                                                          Hi there, I have been facing a problem that my zoho mail doesn't receive mail. See Error in below The MX Records of your domain(s) mydomain.com are not pointed to Zoho and you may not receive emails in Zoho SPF entries in your domains DNS are not configured
                                                                                                        • ZOHO Mail App Not working

                                                                                                          There seems to be an issue with Zoho Mail App today. It is not connecting to server, internet is working fine, tried uninstalling app and reinstalling, loading circle keeps spinning round. Is there an update on the way?
                                                                                                        • Account with own domain, IMAP vs IMAPPRO

                                                                                                          Hi, I have email account with my own domain. I use Em Client email plan and when I use IMAPPRO incoming host, email comes in Em Client only when I restart program. If I use IMAP incoming host everything is ok. Port is 993 both option. Why so? What´s different
                                                                                                        • Automatic Display the Price from CPQ

                                                                                                          Is it possible to display the discounted price from CPQ that I created for my customer? For example, when the customer selects Product A, instead of showing the default price, it should display the discounted CPQ price.
                                                                                                        • Enhancement - Financial Reports

                                                                                                          Hello Everyone, As part of enhancing reports in Zoho Books, we have added an option`Compare With` in Financial reports. Using this, you can compare the current period with Previous Year(s)/Previous Period(s) (Maximum 3 periods). This option is available in the following Financial Reports: * Profit and Loss * Cash Flow Statement * Balance Sheet Please feel free to share your feedback.  We are glad to hear from you. Regards, Nithya - Zoho Books Team.
                                                                                                        • Associating Multiple Work Orders with a Single Invoice in Zoho FSM

                                                                                                          Hello Everyone, Is it possible to associate multiple Work Orders with a single Invoice in Zoho FSM? Best Regards, Subhash Kumar
                                                                                                        • Sent emails not going and showing "Processing"

                                                                                                          Hello Team, Could you please assist with sent emails showing "processing" and not actually going through? Many thanks and regards, Cycology
                                                                                                        • Free Plan mail accounts details

                                                                                                          In the zoho mail pricing there's a free plan that includes: FREE PLAN Up to 25 Users 5GB* /User, 25MB Attachment Limit Webmail access only. Single domain hosting. I need to make sure that I'm able to create multiple email accounts in the form of: name@domain.com
                                                                                                        • Spf cannot verify

                                                                                                          Hello, Thank you for your service. I am not able to configure my SPF. I have follow several times your instructions but it does not work. I cannot verify. My domain is ptjpt.co.id Please help me
                                                                                                        • Custom Function : Copy multilookup field to text field

                                                                                                          Hi, I'm a newbie on function programming, I try to copy text from a multi lookup field named "societe" to a text field named "societe2". I've used this code. In deluge script it seems to work, but when I trigger this function it doesn't work (Societe2
                                                                                                        • Introducing Global Sets for easy management of similar picklists in CRM

                                                                                                          [Update | Sep 2024] We've increased the maximum count limit for global sets. These new limits are now live for AU and JP data centers and will be gradually opened to all. Please check this link for the updated limits. Hello folks, As administrators who
                                                                                                        • TikTok (and other social platform) Messages and comments of the past

                                                                                                          When I link a social channel, Zoho will show in "Inbox", "Messages" and "Contact" sections the interaction done in the past? (comment, messages...)
                                                                                                        • Announcing Zoho Community Developer Bootcamps in India – Extensions

                                                                                                          Hey everyone! We're back with another line-up of Zoho Community Developer Bootcamps in India! Following the success of the first leg of bootcamps on Extensions, we're now ready with the second leg. These bootcamps focus on empowering developers of all
                                                                                                        • Unable to send message:mail rate exceeded limit

                                                                                                          Hi Admin I just got an email that outgoing has been blocked, I know why is the reason said " Mail rate exceeded limit", but I don't know the rule of Mail rate , so please tell me how to avoid the situation and fix this issue , my email id is morgan@homemesh.com.tw.
                                                                                                        • Error when using fetchById in Client Script

                                                                                                          When using client script when creating page (onLoad), I suddenly getting error "Cannot read properties of undefined (reading 'Accounts')" when using: var account_details = ZDK.Apps.CRM.Accounts.fetchById(account_id); I'm getting this error whenever trying
                                                                                                        • Los correos que envio, llegan como spam (Bandeja de correos no deseados)

                                                                                                          Estimados, Buenas tardes, necesito su soporte, los correos que envío desde mi cuenta llegan como spam. (no deseados). ya sea hacia cuentas de hotmail, gmail... etc.. El dominio lo tengo alojado en nic.ar (argentina). Por favor, necesito resolver esto
                                                                                                        • Zoho say my domain seems to be already associated with another account

                                                                                                          I created a website on zoho and associated my domain (bompescado.com) on it. You can see the A record and CNAME are working to it. Now I need to associate the same domain as webmail, but when I try it return with: " This domain name seems to be already associated with another account. If you own this domain, please contact us for assistance." Im following the advice and conctacting you to say I've not been associated this domain on zoho before.  What do I need? Well, I need you manually remove it
                                                                                                        • Zoho Mail Not Receiving or Sending Email

                                                                                                          My zoho mail is not sending or receiving mail. What's the fix for this?
                                                                                                        • Cannot add new mail client

                                                                                                          Hi Guys, I've just got a new laptop and am trying to set up Outlook to connect to my Zoho account. No matter what I do, I cannot connect I'm using IMAP for incoming mail, it's enabled in my account settings, and I'm using the setting shown on the account
                                                                                                        • Zoho Payroll: Product Updates | April 2025

                                                                                                          At Zoho Payroll, we’re always working to make every payday feel effortless. And sometimes, that means listening closely to your unique needs. This month, we’ve focused on adding features that give you the flexibility to pay your employees based on your
                                                                                                        • Zoho CRM to Zoho Projects Workflow {"error":{"code":6831,"message":"Input Parameter Missing"}} connecting

                                                                                                          void automation.Untitled_Function(String ProjName) { resp = invokeurl [ url :"https://projectsapi.zoho.com/restapi/portals/" type :GET connection:"zohoprojects" ]; info "Portal API Response: " + resp; portalId = null; if(resp != null) { if (resp.containsKey("portals"))
                                                                                                        • Zoho mail Virus Scan Virus Detected (but I checked it with VirusTotal)

                                                                                                          Dear all, since this morning we can;t send any attachments out. Zoho says there is a virus in it, but clearly there is not when I checked the file on VirusTotal.com. Please help us out!
                                                                                                        • Cant receive emails

                                                                                                          Hi, I just created an account and went through all steps. Everything has been set up from my end, but Ive sent a test mail to the newly created email address, but it never arrived. Can somebody please help me? Thanks!
                                                                                                        • Next Page