I'm trying to remove some options from an optionSet inside the BPF, but it doesn't work. It only works for fields inside the form.
function cargarRazonesDevolucion(executionContext) { const form = executionContext.getFormContext(); const headerControl = form.getControl('header_process_ao_razon_devolucion_seleccion'); if (!headerControl) return; const control = form.getAttribute('ao_razon_devolucion_seleccion'); const options = control.getOptions(); console.log("OPTIONS", options); let caseType = form.getControl('ao_tipo_caso').getAttribute().getValue()[0].name; console.log("CASETYPE", caseType); options.forEach(item => { if (caseType == 'SOLICITUD' && item.text.includes('reclamo')) { headerControl.removeOption(item.value); } else if (caseType == 'RECLAMACION' && item.text.includes('solicitud')) { headerControl.removeOption(item.value); } }); }