Using the Rollup_the_Potential_Amount_to_Accounts function - not working

Using the Rollup_the_Potential_Amount_to_Accounts function - not working

Hi

I have a custom function using the above code from the Zoho automation guide (link: https://www.zoho.com/crm/help/automation/custom-functions-programming.html).

However, it's not working - the amounts are not being rolled up.

The only thing I can see that may differ is that our Potentials stages are labelled differently, see image below. The code requires that the Stage contains the word 'won'. I have tried changing our Stages to include this word but it hasn't worked (and I don't want to change them as there are lots of workflows and reports which rely on our current naming).

Has anyone else used this custom function?

How long should I expect to wait to see whether it has run or not?