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