Custom function executes in test mode but not as a workflow rule

Custom function executes in test mode but not as a workflow rule

I have written the following function to update a potentials field named Close Date with - simplistically - a hard coded date (which will be replaced with a TODAY function when this is working. 

void workflowspace.Update_Opportunity_Closed_Date (int OpportunityID string ClosingDate 
opportunityID1 = input.OpportunityID.toString() ; 
closeDate = "1/1/2001" ; 
valCloseDate = zoho.crm.updateRecord("Potentials" ,opportunityID1 ,{ input.ClosingDate : closeDate } ) ;

When I click Execute Script, I am prompted for the opportunity ID and field name, and when I enter them the field is updated for that record. 
When I use the script in a workflow rule, along with another command to put some test text in another field, the test text is put into the other field, but the script does not populate the Close Date with 1/1/2001.
In the argument mapping popup the field OpportunityID is mapped to Opportunity ID, and ClosingDate is mapped to the field Closing Date. (which happens to be a date field) 

I'm stumped.