Hi Experts,
How to add a filter to show particular Item in ItemID field of SalesLine Datasource in SalesTable Form.
I want the condition in lookup that-
It will check the "ProductLifecycleStateId" field in "InventTable" Table. If It is not blank than will go inside to "EcoResProductLifecycleState " Form and check the field -"EngChgEcoResProductLifeCycleStateRule_StateRuleName" has value "Sales order" & if Field -"EngChgEcoResProductLifeCycleStateRule_Blocked" has value "Blocked". Than the Item ID field will not show that item in the lookup.
How can I achieve this can anyone help.
Have you opened the view and see whether the view has records?
Just delete the ranges one by one and see which one is causing the issue.
Thanks,
Girish S.
Done the Enum changes. But It's not working
You need to set the Enum element name. Not the labels. Just try setting "Allow" on the range and check.
Thanks,
Girish S.
Enabled is the label, can you try using 'allow' which is its enum value.
Hi Mohit/Girish,
Yes I have blocked option and enabled.
Also, the Blocked status field doesn't has Enable Enum values. Where did you add that Enum element from?
Thanks,
Girish S.
Have you set the relation between two tables in a query.
Also open the view in table browser and check whether the view has been built in correctly and data's are loading correctly.
Thanks,
Girish S.
Do you have value 'Enabled' in Blocked Field? In standard, this enum has 3 values Allow, Warning and Error.
Hi ,
I have written the following code. But it's not showing any Item.
I have Created a Query and added two Data sources using Inner Join and Added that Query in a View .
[FormControlEventHandler(formControlStr(SalesTable, SalesLine_ItemId), FormControlEventType::Lookup)] public static void SalesLine_ItemId_OnLookup(FormControl sender, FormControlEventArgs e) { SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable_View_CAP), sender); // Add the lookup columns sysTableLookup.addLookupfield(fieldNum(InventTable_View_CAP , ItemId)); //sysTableLookup.addLookupMethod(tableMethodStr(InventTable_View_CAP , defaultProductName)); //sysTableLookup.addLookupfield(fieldNum(InventTable_View_CAP , NameAlias)); //sysTableLookup.addLookupfield(fieldNum(InventTable_View_CAP , ItemType)); //sysTableLookup.addLookupfield(fieldNum(InventTable_View_CAP , Product)); //sysTableLookup.addLookupfield(fieldNum(InventTable_View_CAP , PmfPlanningItemId)); // Run the lookup sysTableLookup.performFormLookup(); //cancel the call to super() to prevent the system from trying to show //the lookup form twice and cause an error. FormControlCancelableSuperEventArgs cancelableSuperEventArgs = e as FormControlCancelableSuperEventArgs; cancelableSuperEventArgs.CancelSuperCall(); }
You can use this as how you use table in lookup query.
Thanks,
Girish S.
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156