
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?))
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)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.