Requirement Overview
User should provide the reason before deleting the record in Zoho CRM.
Use-Case
When a record is deleted, the record owner and Zoho CRM super admin should be notified along with the reason, which was provided by the user while record deletion.
Current Challenges to achieve this directly
As of now, we do not have a direct option to make a field or note mandatory when delete button is clicked. As per the use-case, the reason should be provided before deleting the record. Hence, when a user clicks on delete button, a pop up should appear and ask the user to provide the reason for record deletion. Only after providing the reason, user should be able to proceed & delete the record.
The reason can be stored in the custom field or notes of the same record, because the end action is to send an email to the record owner and super admin with the provided reason.
Permissions & Availability
-> Users with the Modules Customization permission can add field into module layout.
-> All the CRM users can use and manage Kiosk if either the permission to Manage Automation or Module Customization is enabled.
-> Users with the Manage Extensibility permission can create connections and write custom functions.
-> Users with the Manage Sandbox permission can manage the sandbox.
Solution
-> To achieve this requirement, we will use the Kiosk Studio feature to capture the user's reason during the record deletion process. The reason will then be sent to both the Super Admin and the record owner via email. Once the details are shared, the record deletion will proceed.
-> The Kiosk will be added as “Delete Button” in the record. So the user will use this Kiosk button instead of Default delete button. Hence, we will restrict the delete permission for the user.
Disable the delete permission for all custom profile except Administrator under Profile permission.
Configuration : Step-by-Step Implementation Guide
Step 1: Firstly, let us add a custom multiline field in the Module layout. So that we can store the reason in that field.
Navigate to Setup (⚙️) in Zoho CRM → Customization → Modules & Fields → select Module → Open Layout.
In case, if you do not want your users to see the custom field, then you can mark it as hidden for all profiles.
Step 2: Create an Email template that needs to be sent when a record is deleted with the reason. Use the merge tag to add the reason in the template. i.e. Email Template Creation
Step 3: Now, we can proceed with Kiosk Configuration. i.e. Kiosk Studio Creation
Navigate to Setup (⚙️) in Zoho CRM >> Customization >> Kiosk studio >> Create Kiosk.
To test your kiosks safely, please create them in the sandbox and then deploy them to the production environment.
1. In the left panel, select the current module based on your requirement.
2. A screen to the Kiosk and within the screen, add a multiline field and mark it as mandatory. Rename the multiline field as “Provide the Reason for deleting the record”. So the users will know what needs to be filled in the field.
3. Then, Add the "Field Update" action. Map the Kiosk Multiline field with the Custom multiline field in the Module layout.
4. Now, Add an Email Notification action and configure the Email template which was created earlier. Also select the recipient as “Record Owner” and “Super admin”.
5. Add a “Custom function action” to delete the record. Use the Zoho CRM - Delete API for deleting the record and use the necessary scopes in connection. Also, ensure to use a Connection which was created by the super admin user.
To know more about Zoho CRM - Delete API - Help Link
To know more about Connection in Zoho CRM - Help Link
Sample Custom Function script to delete a Record
deleteRes = invokeurl
[
type :DELETE
connection:"ZOHOCRM"
];
info deleteRes;
6. At last, add a screen and within that screen, add a text element. Rename the message as “Reason has been updated and deleted the Record successfully”.
Now you could perform a test run with a sample record before activating the Kiosk. Once everything is set up correctly, you could activate and configure it on the button. The button can be configured for both the 'Record Detail' page and the 'List - Each Record' view."
Use-Case Working Screencast
When you click Test Run, you are accessing the kiosk from within the Kiosk Studio. All actions will be executed as specified in Production.To test your kiosks safely, please create them in the sandbox and then deploy them to the Production environment.
Similarly, If you require a more customised Pop-up Window, then you could create a Widget in Zoho CRM which provides enhanced UI using CSS and configure actions using JavaScript. The created widget can be configure in a button within the Record Detail Page. You could refer to the Widget to know more about Widgets in Zoho CRM.
Custom Solution Created by Harish K | Zoho Partner Support