Custom Function to Update Invoice "Contact Name" Field?

Custom Function to Update Invoice "Contact Name" Field?

Hello,

I have created hundreds of invoices in Zoho CRM (in the invoice module).  The Invoices are assigned to an Account, but the "Contact Name" field was left blank.  I need a way to update the Contact Name for all of my past invoices.

Is there a Custom Function that I can create to automate this process?  A function that will look up the Account Name for each Invoice, and populate the Contact Name field with the Contact assigned to that Account?

Thank you.  Any help would be appreciated!