Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

EP custom lookup with multiple table fields

(0) ShareShare
ReportReport
Posted on by 3

Hi,

I tried to add employee name on the Enterprise Portal control custom lookup, because instead of adding display method, we need this employee name in the lookup filter.

I am getting the below error message when I try to add the multiple table on the lookup query. I tried with DirPerson and DirPartyTable. Any idea?

Message: An unhandled error has occurred. To view details about this error, enable debugging in the web.config file or view the Windows event logs.

Source: Microsoft.Dynamics.Framework.Portal

Exception details:

Lookup field was not found in the lookup data set

at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxLookup.ProcessSysDataSetLookup(SysDataSetLookup sysDataSetLookup)
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxLookup.CallDataSetLookupMethod()
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxLookup.LoadLookupDataSet()
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxLookup.HandleLookup()
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxLookup.RaisePostBackEvent(String eventArgument)
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxLookup.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

void dataSetLookup(SysDataSetLookup sysDataSetLookup)
{
List list = new List(Types::String);
Query query;
QueryBuildDatasource qbdhcmworker, qbdsDirPartyTable;

query = new Query();
qbdhcmworker = query.addDataSource(tableNum(HcmWorker));

qbdsDirPartyTable = qbdhcmworker.addDataSource(tableNum(DirPartyTable));
qbdsDirPartyTable.relations(false);
qbdsDirPartyTable.joinMode(JoinMode::InnerJoin);
qbdsDirPartyTable.fields().dynamic(NoYes::Yes);
qbdsDirPartyTable.addLink(fieldNum(HcmWorker, Person), fieldNum(DirPartyTable, RecId));


list.addEnd(fieldStr(HcmWorker, PersonnelNumber));
list.addEnd(fieldStr(DirPartyTable, Name));
//list.addEnd(literalStr('name**'));
list.addEnd(fieldStr(HcmWorker,RecId));
sysDataSetLookup.parmLookupFields(list);
sysDataSetLookup.parmSelectField('RecId');
sysDataSetLookup.parmQuery(query);
}

Thanks,

Hari

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: EP custom lookup with multiple table fields

    I don't think sysDataSetLookup can work with a multi-table query (at least I haven't seen a working example). You can make a simple wiew and use it

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,190 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,968 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans