Update all client Deals records when a specific field is changed in Accounts

Update all client Deals records when a specific field is changed in Accounts

It feels like a simple request and I think I'm overcomplicating it. I have a pick list in the Accounts module called "Industry" and I have created a text field in Deals called "Customer_Industry".

I am trying to build an automation so that when "Industry is changed in a single customer record, all associated Deals are updated too.

Following the guidance here : https://www.zoho.com/crm/resources/tips/functions-update-information-between-two-modules-via-lookup.html I have created the following deluge at this location Setup > Automations > Actions > Functions > Configure Function > Write your own with the module Tasks

  1. voidUpdateDeals(Int dealID,Int customerID)
  2. //Fetch the customer record (aka Accounts)
  3. varCustomerRecord = zoho.crm.getRecordById("Accounts",input.customerID.toLong());
  4. //
  5. // Add fields to be updated here as a map
  6. varValues = Map();
  7. varValues.put("Customer_Industry",varCustomerRecord.get("Industry"));
  8. varResponse = zoho.crm.updateRecord("Deals",input.dealID.toLong(),varValues);
  9. info varValues;
  10. info varResponse;

And this works, but I have to manually enter the record IDs from both modules of the records that I want to update. How do I update all the associated deals records and how does this work in Setup > Automations > Workflow Rules - how do I pass the IDs