Custom function in button in Custom Module

Custom function in button in Custom Module

So I wanted to create a button in my Custom Module that created a new Potential and then updated a field in the corresponding Account. This is my code:

String Untitled_Function8(string customId,string email,string conta_associada,string contacto_associado,string nome_saa,string accountid)

cMap = Map();
cMap.put("Contact Name",contacto_associado);
cMap.put("Account Name",conta_associada);
cMap.put("Email",email);
cMap.put("Stage","Advise");
cMap.put("Potential Name",nome_saa);
create = zoho.crm.v1.create("Potentials",cMap);
accountid_str = accountid.toString();
update_fase = zoho.crm.v1.updateRecord("Accounts",accountid_str,Map:String({"Stage":"SQA"}));
return "";

This code works fine if I Save & Execute Script and input the fields manually but if I try to click the button it gives me an error popup.
From a lot of testing I think the problem might be related to the parameter type being string and not int but when I try to change it, an error also occurs.
Is there something I can change to avoid this problem or is there a better way to write a function to do this?
Thank you in advance.