Skip to main content

Notifications

Announcements

No record found.

Field Service forum

Filter Lookup

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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();

}

}

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans