Client Script - Updating Field Value in Detail Page of a Lead
Hello,
I'm trying to use Client Script To enrich some data of the Lead when one of my User fill the "City" field in the detail page of the Lead.
This is my Script:
log (value);
var response = ZDK.Apps.CRM.Functions.execute("getInfoCitta", { "nomeCitta": value });
datiCitta = JSON.parse(response.details.output);
risultato= (datiCitta.result);
if (risultato) {
log(risultato.cod_fisco);
ZDK.UI.getElementByID("Codice_Catastale").setContent(risultato.cod_fisco);
ZDK.Page.getField("State").setValue(risultato.provincia);
//ZDK.Page.getField("Regione").setValue(risultato.regione);
}
the function getInfoCitta is used to retrieve the info that I need and gives to me the result that I have in risultato, it works and I can see the data in the console if I try To log.
But when I try ti use setContent or SetValue I always get an error (Uncaught (in promise) ZDKError: unsupported action).
I'm on the "show detail" page of the Lead.
Can somebody help me please ?
Thank you
Domenico