I created the following custom function, the issue not is in the mail in Nombre Paciente I am getting the name ID instead the string, how can I send the string name instead de number id?:
if(input.EstadoTarea.matches("Completada"))
{
relatedTasks = zoho.crm.getRelatedRecords("Tasks","Contacts",input.NombrePaciente);
numRelatedTasks=relatedTasks.size();
if((numRelatedTasks % 5) == 0)
{
//múltiplo de 5
//pasamos el ID del contacto a string
stringNombrePaciente=input.NombrePaciente.toString();
sendmail
[
from:zoho.adminuserid
to:zoho.adminuserid
subject:"El paciente " + stringNombrePaciente + " " + input.NombrePaciente + " tiene " + numRelatedTasks + " tratamientos completados"
message:"El paciente " + input.NombrePaciente + " tiene " + numRelatedTasks + " tratamientos Completados.<br>\n<br>\nNombre Paciente: <br>\nPertenece a: <br>\n<br type=\"_moz\">\n<br>"
content type:HTML
]
}
}