web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Dynamic lookup issue

(0) ShareShare
ReportReport
Posted on by

Hi there,

First, forgive me, i'm not a perfect english speaker and i'm totally new in AX dev.

Here is a form (dont look at style and button):

(the fields are : Batch, Item, Site, Location, wmsLocation(wtf?))

0675.Capture1.PNG

I'm trying to filter the result of my lookups according to my previous input. It works but i have problem for displaying. As you can see, some results appears tons of times (field "Site", "Entrepôt" and "Emplacement de départ" has the problem, the others works well)!

Here is the way i'm filtering the lookup "Site" (sorry for french comment) :

public void lookup()
{
    Query                   q = new Query();
    QueryBuildDataSource    qbds1, qbds2;
    QueryBuildRange         qbr;
    SysTableLookup          itemLookup;
    ;

    //Création d'un lookup selon les données entrées précédement
    itemLookup = SysTableLookup::newParameters(tableNum(InventSite), this);

    //Sélection des données pour le lookup
    qbds1 = q.addDataSource(tableNum(InventSite));

    //Check si un lot et un article ont été entrés
    if (CtrlBatchId.text() != "" && CtrlItemId.text() != "")
    {
        qbds2 = qbds1.addDataSource(tableNum(InventDim));

        qbds2.relations(false);
        qbds2.fields().dynamic(NoYes::Yes);
        qbds2.addLink(fieldNum(inventSite, SiteId), fieldNum(InventDim, inventSiteId));
        qbds2.joinMode(JoinMode::InnerJoin);

        qbr = qbds2.addRange(fieldNum(InventDim, InventBatchId));
        qbr.value(strFmt(CtrlBatchId.text()));
    }

    //Ajout des champs au lookup
    itemLookup.addLookupField(fieldNum(InventSite, SiteId));
    itemLookup.addLookupField(fieldNum(InventSite, Name));

    //Attribution des données au lookup
    itemLookup.parmQuery(q);

    //Création du lookup
    itemLookup.performFormLookup();
}

has anybody any proposition to help me ?

PS : Field "Article", "Site", "Entrepôt" are code builded lookup while "Lot" and "Emplacement de départ" are form based lookup.

PS2 : the problem existe on both type of lookup I use.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi,

    i found my misstakes, I was using InnerJoin instead of ExistJoin. Lookups "Site" and "Entrepôt" has been solved, working on my form look up now.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans