Hello everyone, I have a custom field from a purchTable form extension. This one has the self-declaration set to "no". so I wanted to change it from code, but when doing so, it gives me an error that the control was not in control inside the form.
What am I doing wrong and why can't I log in?

This is the control that I must modify the enabled property with declaration in "no", this cannot be passed to autodeclaration "yes"
For this I try to modify the enabled property with code.
[FormDataFieldEventHandler(formDataFieldStr(PurchTable, PurchLine, TaxItemGroup), FormDataFieldEventType::Modified)]
public static void TaxItemGroup_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
FormDataSource purchLine_ds = sender.datasource();
FormRun form = purchLine_ds.formRun();
FormControl NXRLATCLIVANoRec = form.design().controlName(formControlStr(PurchTable, NXRLATCLIVANoRecCodigo));
}