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

                                                                                                            • Connecting Portals from different Zoho apps

                                                                                                              Hi, I note that Zoho has functionality for customer portals for several of the Zoho apps, like CRM, Projects, Desk etc. Is there any way to connect these portals?  It would be great if we could give our customers access to a portal in which they could
                                                                                                            • Not able to item an item to non taxable via api, despite sending is_taxable as false

                                                                                                              Hi everyone, I'm trying to update an item via books api and even when sending is_taxable as false, the item still shows Taxable in zoho, I get no errors as well when I update, any help appreciated in this!
                                                                                                            • Collection & Payment Mapping Automation

                                                                                                              We book Sales Invoices and Purchase Invoices against Same Projects. Both Sales Invoices & Purchase Invoices can have one or multiple Projects mentioning the Project ID. We prefer to Make vendor Payments Once we have received The Collections from Clients
                                                                                                            • Nested Sub-forms (Subform within subform)

                                                                                                              Hi Team, Whether there is any possibilities to add sub-form with in another sub-form like Main Form       -> Sub form A             ->Sub form B If we tried this, only one level of sub form only working.  Any one having any idea about this? Thanks Selvamuthukumar R
                                                                                                            • Restore Trashed Records Anytime Within 30 Days

                                                                                                              Access the recycle bin from the Data Administration tab under the settings page in Zoho Projects, which gives better control over the trashed data. When records like projects, phases, task lists, tasks, issues, or project templates are trashed, they are
                                                                                                            • Avoiding Inventory Duplication When Creating Bills for Previously Added Stock

                                                                                                              I had created several items in Zoho Books and manually added their initial stock at the time of item creation. However, I did not record the purchase cost against those items during that process. Now, I would like to create Purchase Orders and convert
                                                                                                            • Applying EUR Payments to USD Invoices in Zoho Books

                                                                                                              Hello, I have a customer to whom I issue invoices in USD. However, this customer makes payments in both EUR and USD. I have already enabled the multi-currency feature in Zoho Books Elite, but I am facing an issue: When the customer makes a payment in
                                                                                                            • How to prevent users from editing mail merge templates from Zoho crm

                                                                                                              We want users to use public mail merge templates. They should not be able to edit templates but only preview data merge and send emails. We did prohibit "manage mail merge template" in the user profile. But they can still edit the template in the zoho
                                                                                                            • Customer Addresses cannot be edited/deleted in invoices

                                                                                                              In the invoices we have an option to change the customer address and add a new address Now I dont know why for some reason if we add an address through this field, the address doesn't appear in the customer module We cannot delete the addresses added
                                                                                                            • Custom Fields connected to Invoices, Customers, Quotes, CRM

                                                                                                              I created the exact same custom fields in Books: Invoices, Customer, Quotes, and in CRM but they don't seem to have a relationship to one another. How do I connect these fields so that the data is mapped across transactions?
                                                                                                            • Accelerate Github code reviews with Zoho Cliq Platform's link handlers

                                                                                                              Code reviews are critical, and they can get buried in conversations or lost when using multiple tools. With the Cliq Platform's link handlers, let's transform shared Github pull request links into interactive, real-time code reviews on channels. Share
                                                                                                            • Heads up: We're going to update the VAT Summary table's visibility (UK and Germany Editions)

                                                                                                              Hello users, Note: This change only applies to organisations using the UK and Germany editions of Zoho Books. Currently, if you've enabled the VAT Summary table in a template, it will be displayed only in PDFs sent to your customers whose default currency
                                                                                                            • Partial payment invoicing

                                                                                                              Greetings I have questions related to payments and retainer invoices: 1. When I want to issue a partial payment invoice, I can't specify the portion to be paid or already paid, then balance to be shown as Due. 2. Retainer invoice is only available as
                                                                                                            • Inputting VAT Pre-Registration expenses for first VAT Return

                                                                                                              Hi Zoho, I've just registered for VAT and am setting up Zoho to handle calculations and VAT return submissions. I'm struggling to figure out how to input the last 4 years worth of expenses into Zoho so that they're calculated in the VAT module. When I
                                                                                                            • Anyone else experiencing very slow loading of pages in Zoho Projects?

                                                                                                              I reported this yesterday only to be told there are no issues but is anyone else experiencing stupidly slow loading of pages. On our loading screen, it is taking often as long as 60 seconds to load a page and just stays on this screen for ages! Other
                                                                                                            • Zoho Desk Lookup Field Reporting

                                                                                                              Thank you for adding the ability to add additional lookup fields for desk tickets. My question is how do you report against these fields? For example: Associating related accounts to the primary desk ticket account, I am not able to add the lookup fields
                                                                                                            • Integrating asana will cause notification messages to pop up continuously

                                                                                                              When I create or edit a task in Asana, the Asana bot keeps updating messages to group chat, which causes the cliq to keep popping up notifications.
                                                                                                            • Is there an API to "File a Ticket" in Desk

                                                                                                              Hi, Is there an API to "File a Ticket" in Desk to zoho projects?
                                                                                                            • Entire notebook that had notes has disappeared

                                                                                                              I don't know how tf this happened. All I did was uninstall and reinstall the mobile app after fixing a bug I had. After I reinstalled the app, everything was synced back except for one folder which had a bunch of notes in it. None of those notes are in
                                                                                                            • My site has disappeared from web builder

                                                                                                              www.mproperties.uk My site above is still working. However it has completely disappeared from my Zoho sites' web builder. I am therefore unable to edit my site whatsoever. Please help.
                                                                                                            • Kaizen #147 - Frequently Asked Questions on Zoho CRM Widgets

                                                                                                              Heya! It's Kaizen time again, folks! This week, we aim to address common queries about Zoho CRM Widgets through frequently asked questions from our developer forum. Take a quick glance at these FAQs and learn from your peers' inquiries. 1. Where can I
                                                                                                            • Trying to trigger email notification based on rollup summary field

                                                                                                              Hi there, I'm trying to trigger an email notification via Workflow Rules wherever the rollup summary field "Total Shipments" goes from empty to not empty. However this field is not available from the picklist of options in the Workflow rule. Can anyone
                                                                                                            • zia data enrichment - switch to webamigo Extension

                                                                                                              Hello, I have so far used data enrichment via Zia. Now I have installed the Webamigo extension to expand personal data. Unfortunately, nothing has changed after the installation; are there any additional steps needed to switch from the previous method
                                                                                                            • Rich-text fields in Zoho CRM

                                                                                                              Hello everyone, We're thrilled to announce an important enhancement that will significantly enhance the readability and formatting capabilities of your information: rich text options for multi-line fields. With this update, you can now enjoy a more versatile
                                                                                                            • Export Timeline

                                                                                                              With the new Timeline features, it would be really helpful to have the option to export a timeline. When handling customer complaints, having the full breakdown of everything that happens on a module is great but we usually have to send this to another
                                                                                                            • Interactions Tab in Zoho CRM: A 360° Omnichannel View of Every Customer Touchpoint

                                                                                                              Hello Everyone, Hope you are well! We are here today with yet another announcement in our series for the revamped Zoho CRM. Today, we introduce Interactions Tab a new way to view all customer interactions from one place inside your CRM account. Customers
                                                                                                            • How to resubscribe a contact marked as "Unsubscribed (Marked by Recipient)" without using a form?

                                                                                                              Hello, I have a question regarding Zoho Marketing Automation functionality. Is there a way for an administrator to change the subscription status of a contact marked as "Unsubscribed (Marked by Recipient)" back to "Subscribed" without using a form? Ideally,
                                                                                                            • Linkedin: when Zoho Social is going serious with it?

                                                                                                              Hi, it's been said in the past that Linkedin related features in Zoho Social were well behind those of other social networks because of limitations imposed by the platform. Now that we see around my tools (take taplio.com) frankly outpacing ZSocial on
                                                                                                            • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ(7/24)

                                                                                                              ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 7月開催のZoho ワークアウトについてお知らせします。 2ヶ月ぶりに、渋谷にて「リアル開催」します! ▷▷詳細はこちら:https://www.zohomeetups.com/20250724Zoho ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho ワークアウト」を開催します。 Zoho サービスで完了させたい設定やカスタマイズ、環境の整備など……各自で決めた目標達成に向け、
                                                                                                            • How to get fields centered in a form?

                                                                                                              Is it possible to center fields in a form? Some of my forms do some don't and it is really not aestheticly pleasing?  Any help would be greatly appricated. Thanks, Michael McNeill 
                                                                                                            • Make Packages from multiple sales order of a single customer

                                                                                                              Our customers sends orders to us very frequently, some times what customer wants is to ship items from 5 to 6 sales orders in a single shipment. it will be very nice if, zoho can implement this function, in which we can select items from other sales orders of the customer.
                                                                                                            • Webhooks and Integration

                                                                                                              Hey, I was looking to create automation using webhooks or something equivalent of a trigger based mechanism, to connect it as an integration. But I don't find any relevant APIs to setup these webhooks/notifcations for the "Zoho Books". Can anyone please
                                                                                                            • Zoho Books X Zoho Expense

                                                                                                              Hello there, Please can you tell me if it is possible to sync from Books to Expense? I much prefer the Expense reports to that of Books and the Credit Card feeds work via expense and not Books for me. However I find books is much better to deal with the
                                                                                                            • ABILITY TO LOG INTO CUSTOMER PORTAL

                                                                                                              I think it would be very helpful to have a button in Zoho Books to be able to see the customer portal so we can see what they see to help them navigate through the portal. Many times, the customer will call about the portal, but without visibility into
                                                                                                            • Sort, filter & save views for BOOKS PROJECTS

                                                                                                              Thanks for all the updates. Our firm uses the module for simple internal project accountancy. This means we do everything from the Projects Section but this isn't user friendly at all. You can't do anything with customized your own fields which basically
                                                                                                            • edit input format in custom field - sales order

                                                                                                              hi, I want to integrate a custom field (multi line text box) in our sales order. It needs to show upper case and lower case letters, numbers, spaces, hyphens and "/". What do I need to put in the custom format to configure these signs? Thanks, Tina
                                                                                                            • This transaction type cannot be matched with a line on the statement.

                                                                                                              When using the books API https://www.zohoapis.com/books/v3/banktransactions/uncategorized/${transaction.transaction_id}/match I get this error "This transaction type cannot be matched with a line on the statement." What I'm doing is for the uncategorized
                                                                                                            • Full Text Customization & Translation in SalesIQ Chat Widget Settings

                                                                                                              Dear Zoho SalesIQ Team, Greetings, We would like to request an important enhancement to the chat widget customization options in Zoho SalesIQ. Current Limitation: At the moment, only some of the text shown in the chat widget is editable or translatable
                                                                                                            • Power of Automation :: Quick way to associate your Projects with Zoho CRM

                                                                                                              A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate complex tasks and
                                                                                                            • Timesheets

                                                                                                              I wanted to create the timesheets remainder for our team mates who miss out the weekly timesheet entries. While creating the email templates, I couldn't see anything related to timesheets. Since it shows projects Can you help me find and build a one
                                                                                                            • Next Page