How can I compare a button's action to a value?

How can I compare a button's action to a value?

I am new to zoho books so I am trying to understand how api, custom functions work?I want to know whether I can compare button action to a value and change status? 
Here's the thing. I am trying to create a custom function to change the customer status(values are lead,quote,sales order,inv) whenever quotation or sales order or invoice is created for that customer.
Whenever invoice is clicked from new transaction dropdown, I want customer status to change to inv. Another condition is that customer category has to be 'walk-in'(customer_category is a custom field I created.It is a dropdown with two values --walk-in and referral).Only then, these customer status are needed.
Is there a  way to do that? Also I am not able to see the api for customer_status (which I created ,but made visibility to only me). 
If anyone could help me, that would be great!
Thanks in advance


    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