Hello, I script a custom function linked to a butom, in Contacts (contact view) that creates a record in a Custom Module.
I need to pass the contact name to link this new record with the contact.
The next code works fine the first time, but if I delete de created record and I repeat de custom function (clicking the buttom again) doesn't work well. Create the record without the contact name.
This is the code:
- nombre_Cliente=input.firstName; // from Contacts
- apellidos_Cliente=input.secondName; // from Contacts
- cliente=nombre_Cliente + " " + apellidos_Cliente;
- mapaMovCaja=map();
- mapaMovCaja.put("Cliente",cliente); // 'Cliente' is the Contact Lookup field name
- crmMovCaja = zoho.crm.create("CustomModule1",mapaMovCaja,2);
Please, why this code works well first time but doesn't if I delete the record and try again.
I need a stable solution that works every time I click the buttom in Contact view.
Thank you very much in advance.
Best Regards :)