Hi,
I have just tried below code on Lead for OOB Lead Source field and it worked.
function cargarRazonesDevolucion(executionContext) {
const form = executionContext.getFormContext();
const headerControl = form.getControl('header_process_leadsourcecode');
if (!headerControl)
return;
headerControl.removeOption(930720003);
}
Please check below conditions in your code. Add alert inside condition and see it it is going inside.
I suspect there is something wrong with the condition.
if (caseType == 'SOLICITUD' && item.text.includes('reclamo')) {
headerControl.removeOption(item.value);
} else if (caseType == 'RECLAMACION' && item.text.includes('solicitud')) {
headerControl.removeOption(item.value);
}
If found helpful, Please mark my answer verified.