Zoho Creator -> Custom Function Update Multiple Fields

Zoho Creator -> Custom Function Update Multiple Fields

Hi is it possible to create a custom function to update muiltiple fields on :
- main form
- within subform

main form example:-
- main form has A,B,X,Y,Z fields
- any changes to the X or Y would automaticlly update Z,A & B
- right now i use "on edit" on both X and Y
- was wondering whether there is a better way for both X and Y to call a cusom function.

similar example can be used to refered to a subform row.

a simple example would be appreciated.

thanks