Function #48: Tracking refunds and adjusting the sales executive's revenue in Zoho CRM

Function #48: Tracking refunds and adjusting the sales executive's revenue in Zoho CRM



Welcome back everyone!

Last week's function was about creating an event from Deals automatically. This week, it's going to be about real-time recording of refunds and sales revenue tracking based on the refunds.

Business scenario

Having a clear refund policy goes a long way in gaining customer trust. Depending upon the line of business, the refund window might vary. This is even more important in the case of online purchases where customers get to see and feel the product only after making the purchase.

The Deals module in CRM helps track the revenue associated with the sales executives. By taking a report of all the 'won' businesses pertaining to a month, you'll be able to calculate the revenue associated with the sales executives concerned. Recently one of our users asked if there is any working solution to track refunds. Typically, the refund period is 30 days and the refunds have to be tracked without affecting the revenue numbers from the preceding month. Hence updating the closed Deal stage to a "Refunded" stage won't work.

A simple solution to this problem is to clone the won deal that needs to be refunded and make the following updates in the cloned deal:
  • Update the deal value in negative to account for the refund amount

  • Update the deal closing date to current date.

  • Update the status of the cloned deal to "Refunded".

This leaves the revenue numbers of the preceding months and the sales forecast for the current month intact while accounting for the refunds too. Expecting your sales executives do all these steps manually is a tall order. Fret not, the Function I'm sharing this week helps you do all these steps at the click of a button.

Pre-requisites

  • Create a Deal Status named "Refunded".

Getting started with the function

  1. Go to Setup > Customization > Modules > Deals > Links and buttons > Create new button.
  2. Provide a name for the button. For example: "Refund". Add a description(optional).
  3. Select the placement of the button as View page.
  4. Select the action to be performed as "Writing function".
  5. Copy the code given below.
  6. Click “Edit arguments”.
  7. Enter the name as “dealId” and select the value as “Deal Id”.
  8. Click Save&Execute Script.
  9. Save the script.
  10. Select the profiles who can view this button.
  11. Click Save.


The Code

-----------------------------------------------------------------------------------------------------------------------

dealDetails = zoho.crm.getRecordById("Deals", input.dealId.toLong());
mp=map();
mp.put("Deal_Name",ifnull(dealDetails.get("Deal_Name"),""));
mp.put("Owner",ifnull(dealDetails.get("Owner"),"").get("id"));
mp.put("Account_Name",ifnull(dealDetails.get("Account_Name"),"").get("id"));
mp.put("Contact_Name",ifnull(dealDetails.get("Contact_Name"),"").get("id"));
mp.put("Amount","-"+ifnull(dealDetails.get("Amount"),""));
mp.put("Stage","Refunded");
mp.put("Closing_Date",today);
create=zoho.crm.create("Deals", mp);
info mp;
info create;
return "success";

-----------------------------------------------------------------------------------------------------------------------

Before Refund



After Refund



Note

  • The code given above works only for V2 version of Zoho APIs. Please note that the code WILL NOT work for Version 1.0 APIs.

Found this useful? Try it out and let me know how it works! If you have questions, do not hesitate to ask! Do check out other functions shared in this series here.

See you all next week with another interesting function. Ciao!





                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation
                                        • Sticky Posts

                                        • ZUG (Zoho User Group) In-person Meetups - Learn, Share, and Discuss All Things Zoho

                                          Hi, We hope you are all doing well. We are excited to announce the second leg of our in-person Zoho User Group (ZUG) meetups in your region. A quick update: Our first leg of meetups in 2024 reached completion, and Zoho experts had the opportunity to meet
                                        • Tip #35 - On using Kanban View in Zoho CRM

                                          Hi folks,  It's that time of the week again, and I am back with a quick tip about using Kanban View in Zoho CRM. If you think you missed any of our previous weeks' tips, you can read them here.  Tip #35 - On using Kanban View in Zoho CRM You deal with so many records in CRM every single day! When you click open each module in Zoho CRM, you have hundreds of records, each in various stages of your sales pipeline. Wouldn't it be cool if you had them all sorted automatically without having to filter
                                        • ZUG (Zoho User Group) In-person Meetups - Learn, share and discuss all things Zoho

                                          Hi, Hope you all are well. We're excited to announce our second leg of in-person Zoho User Group (ZUG) meetups in your region. A quick update - Our first leg of meetups in 2024 progressed and reached completion smoothly, where Zoho experts had the opportunity
                                        • ZUG (Zoho User Group) In-person Meetups - Learn, share and discuss all things Zoho

                                          A big warm hello to the Zoho Community, and Happy new year to all of you! We're thrilled to let you know that our ZUG Meetups for 2024 have almost begun, and we can't wait for you to be a part of them. We have some interesting topics in store for this
                                        • Cloning Email Templates across modules in Zoho CRM.

                                          The option of cloning email templates across modules has been a long standing feature request from the Community. Thank you all for being so patient with us. We are happy to inform you all that this enhancement has been rolled out. Just in case you haven't noticed it already, cloning email templates is possible now! Cloning is useful because it cuts down the hassle of having to create the same email templates again for different modules. Here are the steps: Navigate to Settings---> Customization--->Templates


                                        Manage your brands on social media



                                                Zoho TeamInbox Resources

                                                  Zoho DataPrep Resources



                                                    Zoho CRM Plus Resources

                                                      Zoho Books Resources


                                                        Zoho Subscriptions Resources

                                                          Zoho Projects Resources


                                                            Zoho Sprints Resources


                                                              Qntrl Resources


                                                                Zoho Creator Resources


                                                                  Zoho WorkDrive Resources



                                                                    Zoho Campaigns Resources

                                                                      Zoho CRM Resources

                                                                      • CRM Community Learning Series

                                                                        CRM Community Learning Series


                                                                      • Tips

                                                                        Tips

                                                                      • 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