Can I call a custom function from a button action function?

Can I call a custom function from a button action function?

Most buttons that I have perform some common actions. For example, they perform a security check. The owner of the record must equal the logged in user. Or the logged in user must be the manager of the record owner. This prevents users from submitting changes to records they do not own.

I would like to make a custom function called, say, userPermissionCheck that I can call within the custom action function for each button. Instead of including a copy of the code in 10 buttons, I would have 1 function used by 10 buttons. This reduces code management cost and risk of errors introduced by having multiple copies of the code.

I have read the forums and have not found a solution. This looks close: https://www.zoho.com/crm/developer/docs/functions/set-up-functions.html#Function_REST-API. Am I supposed to create a stand-alone custom function and call it using the API in the button's custom action function?

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              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 Campaigns 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