I have two field was named Type and Status and I would to filter the lookup of status according to type field selected.
I have created this event handlers but when i click in the status lookup, that don't open and it display this erros : "selectmode called with invalid parameters d365"
class AccountDNA
{
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[FormControlEventHandler(formControlStr(Account, Account_Status), FormControlEventType::Lookup)]
public static void Account_Status_OnLookup(FormControl sender, FormControlEventArgs e)
{
Account Account;
AccountTypeStatus AccountTypeStatus;
QueryBuildRange qbr;
Query query = new Query();
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(Account), sender);
queryBuildDataSource qbds = query.addDataSource(tableNum(Account));
qbr = qbds.addRange(fieldNum(Account, Status));
qbr.value(SysQuery::value(Account.AccountType==AccountTypeStatus.Type));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
ce.CancelSuperCall();
}
}