Record Lockings APIs in Zoho CRM

Record Lockings APIs in Zoho CRM

Hello everyone!

Welcome to Kaizen! In the previous Kaizen post, we discussed Record Locking Configuration APIs. In this post, we will discuss Record Locking APIs in Zoho CRM.
Record locking refers to the restrictions applied to a record to prevent changes to its data. Records can be locked manually or automatically. Record Locking Configuration APIs are used to set the configuration required for record locking.

Locking Information Module

When record locking configuration is enabled for any module, a new module will be created in the CRM with the API Name Locking_Information__s that contains the details related to locking information. Details related to this module can be retrieved using the Modules API (endpoint: /settings/modules) and corresponding fields can be fetched via Fields META API (endpoint: /settings/fields?module=Locking_Information__s). The fields of Locking_Information__s  module are:

Name
Data Type
Description
Locked_Reason__s  
textarea
Reason for locking the record.
Lock_Source__s
picklist
Indicates whether the record was manually locked or automatically locked. Possible values: Automatic, Manual
Locked_For__s
multi module lookup
This field contains the details of the name and id of the record which is locked and also the api_name and id of the the record's module.
Locked_Time__s
datetime
Time the record was locked.
Locked_By__s
user lookup
Details of the user who locked the record(manual locking). 
id
bigint
ID of record locking information.This id is referred as record_locking_id in the below APIs
Record_Locking_Rule_Id__s
bigint
ID of the record locking rule inside the module's record locking configuration
Record_Locking_Configuration_Id__s
bigint
ID of the record locking configuration.
Feature_Type__s
picklist
Represents feature type (possible value:record_locking)

When a record gets locked in any module, corresponding details are stored in the Locking_Information__s module as a new record.  
The ID key inside the Locked_For__s json object in Locking_Information__s module points to the locked record.

   "Locked_For__s": {
                "module": {
                    "api_name": "Deals",
                    "id": "5843104000000002181"//id of Deals module
                },
                "name": "Commercial Press",
                "id": "5843104000001068086"//id of locked record i.e.{record_id}
            }

Deleting the record inside Locking_Information__s module unlocks the locked record.
However, these actions have to be performed using Locking_Information__s Related Record APIs of the record.
URL Pattern for the same is
{api-domain}/crm/{version}/{module_api_name}/{record_id}/Locking_Information__s [POST]
{api-domain}/crm/{version}/{module_api_name}/{record_id}/Locking_Information__s/{record_locking_id}[GET/PUT/DELETE]

With this API, you can retrieve the locking information of locked records.
Request URL:
{api-domain}/crm/{version}/{module_API_name}/{record_id}/Locking_Information__s/{record_locking_id}
OR
{api-domain}/crm/{version}/{module_API_name}/{record_id}/Locking_Infortmation__s?fields={field_name_1},{field_name_2}

HTTP Method: GET
Please note that the fields parameter is mandatory when you are not passing the record locking id in the endpoint.

Consider that the record locking configuration for deals module is configured to automatically lock a record when it reaches the closed lost stage. A deals record in closed lost stage gets automatically locked. You can obtain the details of the locking information using this API.
Sample Request URL to fetch the locking information of a record in Deals module:
[GET] {api-domain}/crm/v5/Deals/5843104000001068077/Locking_Information__S?fields=Locked_For__s,Locked_Reason__s,Lock_Source__s,Locked_Time__s,Locked_By__s,Record_Locking_Rule_Id__s,Record_Locking_Configuration_Id__s,Owner,Parent_Id
Response Body:
{
    "data": [
        {
            "Locked_By__s": null,
            "Locked_For__s": {
                "module": {
                    "api_name": "Deals",
                    "id": "5843104000000002181"
                },
                "name": "Commercial Press",
                "id": "5843104000001068077"
            },
            "$field_states": null,
            "Locked_Reason__s": null,
            "$editable": false,
            "$sharing_permission": "read_only",
            "Lock_Source__s": "Automatic",
            "Locked_Time__s": "2023-10-23T17:46:17+05:30",
            "Record_Locking_Configuration_Id__s": "5843104000001068044",
            "Record_Locking_Rule_Id__s": "5843104000001068069",
            "id": "5843104000001072001",
            "Feature_Type__s": "record_locking",
            "$zia_visions": null
        }
    ]
}

Lock Records API

In certain scenarios, even if the record does not meet the configured locking criteria, you call the below API to manually lock it to prevent any changes to the record.
Request URL:
{api-domain}/crm/{version}/{module_API_name}/{record_id}/Locking_Information__s
HTTP Method: POST

For instance, you are handling a deal and want to temporarily prevent any modifications to the deal information because the deal is in the last round of negotiations. You can choose to manually lock the record using the Lock Records API.
Sample Request URL for manually locking deals record: 
[POST] {api-domain}/crm/v5/Deals/5843104000001068086/Locking_Information__s
Request Body:
{
    "data": [
        {
            "Locked_Reason__s": "last round of negotiations "
        }
    ]
}

Update Record Locking Information API 

The locked reason for a manually locked record can be updated using Update Record Locking Information API.
Request URL:
{api-domain}/crm/{version}//{module_API_name}/{record_id}/Locking_Information__s/{record_locking_id}
HTTP Method: PUT

Consider that you want to modify the locked reason for the above locked record. 
Sample Request URL to modify locked reason for the above locked deal:
[PUT] {api-domain}/crm/v5/Deals/5843104000001068086/Locking_Information__s/5843104000001068094
Request Body:
{
    "data": [
        {
            "Locked_Reason__s": "awaiting final approval"
        }
    ]
}

Unlock Records API

This API can be used to unlock a manually locked record.
Request URL:
{api-domain}/crm/{version}/{module_API_name}/{record_id}/Locking_Information__s/{record_locking_id}
HTTP Method: DELETE 

Consider that you want to unlock the above deal to move it to closed won stage. You can unlock the deal using this API.
Sample Request URL to unlock the above deal:
[DELETE] {api-domain}/crm/v5/Deals/5843104000001068086/Locking_Information__s/5843104000001068094
Response Body:
{
    "data": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "5843104000001068094"
            },
            "message": "relation removed",
            "status": "success"
        }
    ]
}

We hope you found this article useful. We will be back next week with another interesting topic. If you have any questions, write to us at  support@zohocrm.com  or let us know in the comment section.
Please take a look at our Kaizen collection here.

Cheers!



    Access your files securely from anywhere







                            Zoho Developer Community





                                                  Use cases

                                                  Make the most of Zoho Desk with the use cases.

                                                   
                                                    

                                                  eBooks

                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                   
                                                    

                                                  Videos

                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                   
                                                    

                                                  Webinar

                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                   
                                                    
                                                  • Desk Community Learning Series


                                                  • Meetups


                                                  • Ask the Experts


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner




                                                            • Sticky Posts

                                                            • Kaizen #197: Frequently Asked Questions on GraphQL APIs

                                                              🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                            • Kaizen #198: Using Client Script for Custom Validation in Blueprint

                                                              Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                            • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

                                                              Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
                                                            • Kaizen #193: Creating different fields in Zoho CRM through API

                                                              🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                            • Client Script | Update - Introducing Commands in Client Script!

                                                              Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands


                                                            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

                                                                                                            • Implement full RTL support in Zoho Cliq, including text alignment and character positioning, regardless of the interface language.

                                                                                                              Dear Zoho Cliq Support Team, We are writing to request a significant enhancement to the current RTL language support within Zoho Cliq. Currently, while Zoho Cliq allows users to input text in RTL languages, the text alignment remains LTR, resulting in
                                                                                                            • Email Alerts with Affected Flow Details When Deprecating Modules in Zoho Flow

                                                                                                              Dear Zoho Flow Team, We would like to request an enhancement to the module deprecation process in Zoho Flow. 🧩 Current Limitation: Currently, when a module is deprecated by the Flow team: No email notifications are sent. There is no automated way to
                                                                                                            • are there Url parameters to group records in the report/view?

                                                                                                              There are URL parameters to filter records in target report.  Is there any way to group records in report by certain field, using URL parameters or embed report parameters? Or any other workaround, apart from creating second report for dofferent grouping?  Aim: I want to provide user a quick link to re-group embed report by different fields.
                                                                                                            • Setvalue() client script not working

                                                                                                              I have created a client script on the load the record(detail view page). I wanted to populate some default information in the single line field. for that I created the client script. below is the script: var field_obj = ZDK.Page.getField( 'Designation'
                                                                                                            • Power of Automation :: Automate Deal Status Update in Zoho CRM upon Project Completion.

                                                                                                              Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:
                                                                                                            • Leverage the power of Zia (AI) to create Marketing Projects in Zoho Marketing Plus

                                                                                                              Hey everyone, Zoho's advanced AI assistant, Zia, now works with OpenAI to offer personalized marketing activity suggestions for your marketing projects in Brand Studio. With information such as your campaign's objective, duration, marketing channel types,
                                                                                                            • Use Zoho Flow to Supercharge your Zoho FSM Integrations

                                                                                                              We are thrilled to announce that Zoho FSM is now included in Zoho Flow - Zoho’s powerful no-code integration platform. With this, you can connect Zoho FSM with your most-used applications—without requiring technical expertise. What does this offer? Zoho
                                                                                                            • Zoho Flow triggers not working

                                                                                                              Hi , I have set up a flow which triggers when a new record is created in a Zoho Creator app. This flow works great when I initiate the flow with  "test and debug". However the flow does not trigger in live mode.  I have tested all the connections used
                                                                                                            • Can you sync your Apple Calendar with Bigin Activities/calendar?

                                                                                                              I've searched everything I can find and nothing is coming up... I've got a number of things in my calendar for the future, and it would be easiest if I can sync between them to update my availability for my booking page (also syncing the other way would
                                                                                                            • How to track salesiq on google analytics without GTM

                                                                                                              Hello! We had to move the installation of the SalesIQ widget from GTM to directly do it in our wordpress site. The SalesIQ widget was being blocked by Adblockers which caused a lot of our visitors to not be able to see it. This issue was fixed from deleting
                                                                                                            • Custom Module Count

                                                                                                              We are on Zoho One. CRM says that the three modules which support Zoho Sign integration are "custom modules." Do these count against the 200 custom modules permitted by the One access to "enterprise-level" CRM features?
                                                                                                            • Marketer's Space: Bookmarks by Zoho Campaigns

                                                                                                              Hello Marketers, In this week's Marketer's Space, we'll look at a simple yet powerful feature that makes a big difference in your workflow: Bookmarks. Bookmarks is a built-in feature in Zoho Campaigns that enables you to create a personalized library
                                                                                                            • I need a custom AI Chatbot to be integrated with ChatGPT to Handle Customers inquiries

                                                                                                              I need a custom AI Chatbot to be integrated with ChatGPT to handle Customer inquiries, and save the data to Zoho CRM as a Leads, Also to schedule a demo with clients and more options
                                                                                                            • User Management > Agents request

                                                                                                              I have a few suggestions for the Agent page: 1) Please add a way to filter Full agents. The list currently shows Light agents as an option but sometimes it would be helpful to view only the full agent licenses or non-light agent. 2) Add the ability to
                                                                                                            • Mandate Assessments in Zoho Recruit's Candidate Application Form

                                                                                                              We're excited to announce the Include Assessment option for the Candidate Application Form, which lets you display the pre-screening assessment associated with the job opening along with the application form fields. This ensures that every candidate applying
                                                                                                            • Sending an email from contacts does not display the recipient's name correctly

                                                                                                              When I select a contact or group of contacts and then click the envelope to send mail, the contacts are added to the To section of a new email. Unfortunately, their First and last names are not displayed. The part of the email address before the @ sign
                                                                                                            • Writing SQL Queries - After Comma Auto Suggesting Column

                                                                                                              When writing SQL Queries, does anyone else get super annoyed that after you type a comma and try to return to a new line it is automatically suggest a new column, so hitting return just inputs this suggested column instead of going to a new line? Anyone
                                                                                                            • Stop adding Default ID column to xls exports

                                                                                                              When anything is exported to xls, Zoho adds a column with an ID. WE DO NOT WANT THIS COLUMN. We use an automated report to a team. We have our own tracking number. 1. This makes the report messy, it just pushes OUR data off to the right. 2. We have to
                                                                                                            • communication distribution

                                                                                                              Hello community! Request for help - how to resolve the issue of subscribing to specific content. I use ZOHO CRM and ZOHO CAMPAIGNS to send email communications to my customers. I only purchased ZOHO CAMPAIGNS after using the CRM for some time and I have
                                                                                                            • Truesync for Linux

                                                                                                              Is Truesync available on linux ?
                                                                                                            • Web access blocked

                                                                                                              Hello, My account (chris@thewebprojects.com) has been blocked due to security reasons. Please see attached. Can you kindly please help me. Thank you in advanced
                                                                                                            • How to determine ZohoCreator organization ID

                                                                                                              I am trying to setup an API to interface with my ZohoCreator app by following the self-client credential flow here https://www.zoho.com/accounts/protocol/oauth/self-client/client-credentials-flow.html However, it requires me to input my organization ID.
                                                                                                            • Autofill Zoho form with Zoho campaign data

                                                                                                              Hello, I send campaigns and we have set a button called "Demo" in that campaign. This button leads to a form. Since we have the data in Zoho Campaign, would it be possible that some fields of the form (first+last name, email, company) are automatically filled when our readers click on this button? If yes, how could I do that? Thanks Aurélie Leyendecker
                                                                                                            • Need to be Amount Adjusted with same Group Comany

                                                                                                              Dear Sir/ Madam, Good Day, Example wise i write my quire Below A B C & D E F Bothe are Same Group Companies We Paid 50000 AED to ABC Company but we received Invoice 48000 AED worth of material Balance 2000 AED invoice i received from D E F. I Need to
                                                                                                            • Transfer between 2 accounts in forein currency

                                                                                                              Hello, While abroad, I have exchanged some money in a money exchange service from a foreign currency (MYR) to another foreign currency (USD) without passing through my base currency (CHF). How do I record this transaction in Zoho Books? When I try to
                                                                                                            • Zoho Books Webhook in Custom Module doesn't work

                                                                                                              I have a custom module "Purchase Request" in Zoho Books in which we're trying to convert status of the PRs to Draft and Pending Approval. We've explored different applications and custom functions but found that the status is not "writable". However,
                                                                                                            • Issue with Missing Scope for Creating Service Report via Zoho FSM API

                                                                                                              Hello @Latha Velu , I am currently working on creating a connection to create a Service Report in Zoho FSM using the API. However, while configuring the required scopes, I noticed that the scope ZohoFSM.modules.ServiceReports.CREATE which
                                                                                                            • Imap Support?

                                                                                                              Does Zoho Books support IMAP? I have enabled outlook integration from settings in Zoho Books Yet the emails I send from Zoho Books for example if I email a purchase order or an invoice I dont see them in it in my sent box in outlook Is there a problem
                                                                                                            • ADDING FUEL SURCHARGE & HST

                                                                                                              Hello I need to invoice the customer showing both Fuel Surcharge & ON HST separately. The FSC should be 20% of the subtotal. The HST should be applied to sum of Subtotal + FSC So it should be like: SUBTOTAL: 100.00 FSC (20%): 20.00 HST (13%): $15.60 How
                                                                                                            • Zoho Project API search?

                                                                                                              Good day, i would like to search our entire portal for a task using the API. We have over 20k tasks so I dont to search for all tasks and then do a for each as it would take way to long and also would need to go over the limit of 200 records per query.
                                                                                                            • Handling Deposits to Vendors and how to book this

                                                                                                              Our scenario: 1. We rent equipment from a renting company for a project (Vendor "Eurorent") 2. We receive an order confirmation with a request to pay a deposit of € 1500. (this is not a Bill) 3. We pay a deposit of € 1500 for the equipment. 4. After using
                                                                                                            • Tip of the Week #61– 5 easy ways to declutter your inbox!

                                                                                                              Managing a shared inbox is easier than you think. With the right tools and a smart approach, your team can stay on top of every conversation, collaborate more effectively, and deliver timely responses without any unnecessary back-and-forth. Here are 5
                                                                                                            • Vertical Solution Zoho One

                                                                                                              Hello, is it possible to create a vertical solution for Zoho One? Just like it is possible for Zoho CRM?
                                                                                                            • Multiple workspaces with in Bigin CRM

                                                                                                              As a freelancer working as a sales representative for two companies, each with its own email address, I would like to know if it’s possible to have two separate workspaces in Bigin. This way, I could manage each company and its contacts independently,
                                                                                                            • Allowing subqueries in FROM clause

                                                                                                              When building a Query table in Zoho Reports, I encountered an error when attempting to put a subquery in the "FROM" clause of my statement.  Why isn't this currently supported?  Is there a plan to implement this functionality in the future?
                                                                                                            • CRM for Everyone - More Actions Option to Create Record

                                                                                                              Please consider the option create a new record for the module from the More Actions menu. I know there is an "Add New" icon further down the menu to create a record for any module, but this just seems more intuitive and could reduce the need for the "Add
                                                                                                            • Zoho books partners: Transferwise, Resolut

                                                                                                              Can anyone tell me if Transferwise and/or Resolut (payment systems) are in integrated?  I know PayPal and Google are, but in Europe we like Transferwise and Resolut is an up and coming multi-currency app. Xero and Transferwise are fully compatible. Thanks
                                                                                                            • Getting oauth errors on bigin

                                                                                                              Hi Support, I'm getting oauth errors on bigin even though it works fine with CRM. I created a self client which will add contacts. I gave every permission you could and it still didn't work. What should I do. I might just switch to the standard CRM since
                                                                                                            • Assessment Field in Custom View

                                                                                                              Zoho recruit finally added the ability to filter Job Applications by Assessment Answers This is a very valuable addition to the Recruit But this is currently missing from the custom view This should be added to the custom view as well
                                                                                                            • Name Change and Delete Email ID and Alias

                                                                                                              Hello please i require urgent assistance, 1.) I would also like to change the name that appears when people receive my emails. I have an info@spacetraiders.com but when people receive my email its say Ronma Adedeji instead of either Info or Space Traiders..
                                                                                                            • Next Page