Calling a function within another function

Calling a function within another function

Hello there,

I have just found out that you can simply call up functions in other functions, regardless of the department. You can't create functions with the same name twice, even though you are in a different department. If you try it, you don't get an error message but Zoho simply inserts a number at the end and counts it up if necessary.

Example:

1. Function:
  1. fun(int param1)



2. Function

Simply use the name of the function and pass the required values if necessary:


If you execute this function, you get the expected result. The info output is displayed as expected:




It's just so super uncomplicated, why isn't it documented anywhere? Or have I just overlooked something?



I would also like to add:

In this zoho community post "You are forced to store/manage custom functions redundantly | Any solutions?" I asked if there is a way to not have to create custom functions redundantly just to be able to use them in different departments in workflow rules.

I received the following answer:



It may not have been possible to call up functions at this time. But if it was, why was this not recommended as a workaround?

I would still have to create a wrapper function for each department, but at least the code would no longer be redundant and would only have to be changed in one place. That's a great thing, isn't it?



My question is, should I call functions in functions in desk? I mean yes, it obviously works, but is it meant to or does it just work by random chance? As I said, I have not been able to find any official info from Zoho that you can call functions in functions, so I would like to ask for this info.


Thanks and regards,
Sven

    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