Hi,
In FRAPPE CRM How To add a script in quickentry layout ,
If I click one select field (response) based on the value of the field another field (Classification) should get updated automatically
Hi @NCP ,
The value Need to be updated in the classification field whenever i select the response field
In detail view , i can able to achieve this but in the quickentry layout the script is not working
The Script which i used in form script
function setupForm({ doc, updateField }) {
let custom_classification = "";
if (doc.custom_response == "As of Now") {
custom_classification = "Hot";
} else if (doc.custom_response == "call me later") {
custom_classification = "Cold";
} else if (doc.custom_response == "May be Later") {
custom_classification = "Warm";
}
// Only update if the classification has changed to avoid constant refresh
if (doc.custom_classification !== custom_classification) {
console.log("Updating custom_classification to", custom_classification);
updateField("custom_classification", custom_classification);
} else {
console.log("No change in custom_classification");
}
return {
custom_classification: custom_classification
};
}