Hi,
My Form is here shown below. I Used Two filters (From Date, To Date), and ( Site and Warehouse). When i used From and To Date filters it will filter the grid between the transaction date. If i use the Site and Warehouse filter. It is a Multiselect lookup filter.
I had selected the site no 1,12,2 but in my Warehouse Filter control it shows only 1 and 12 site and its warehouses. Because i had chosen the 1 and 12 site first. I need that all the site and warehouses i chosen at Site filter control in the warehouse filter lookup.
This is my Warehouse filter control Lookup code.
public void lookup()
{
SysLookupMultiSelectCtrl slmsc;
Query query;
QueryBuildDataSource qbds;
List list;
ListIterator itr;
list = new List(Types::String);
list = strSplit(Site.valueStr(),";");
itr = new ListIterator(list);
query = new Query();
qbds = query.addDataSource(tableNum(InventLocation));
qbds.fields().addField(fieldNum(InventLocation,InventLocationId));
qbds.fields().addField(fieldNum(InventLocation,InventSiteId));
if(Site.valueStr()!="")
{
while(itr.more())
{
qbds.addRange(fieldNum(InventLocation, inventsiteid)).value(itr.value());
itr.next();
}
}
else
{
throw error('Please choose Site');
}
slmsc = SysLookupMultiSelectCtrl::constructWithQuery(element,warehouse,query);
super();
}
Thanks & Regards,
Ram.
Hello Guys,
Can anyone tell me how the ware house issue in this scenario is fixed, in the whole thread i didn't find the solution for that.
Thanks
Chaitanya
Yeah Martin,
I have used the Queryrun object and then i have refreshed the queryrun object. It works fine.But i am facing some issues. When i am adding my sites in the site control it woks fine. Here the image for you reference. Here i have used syslookupmultiselectctrl class for multiselection lookup. The lookup method fires only first time of clicking the control.
But when i unselect from the site control the warehouse control shows the last selected values, the value for the unselected site also shown in the warehouse control. Here is the image i have removed the No: 2 site but in the warehouse control shows for the warehouse values for the No: 2 site also. Do you have any suggestions.
Regards,
Ram.
Great!
Can you please share the solution for others who have a similar problem and find this thread?
Hi Martin,
Yeah i have solved the issue. Thanks for your suggestions.
Regards,
Ram.
Can you share a simplified sample solution (e.g. as an .xpo)? If reproducing your problem takes less time, there will be a better chance that somebody looks on it.
Hi Martin,
Yeah , Shall you give the solution for this.
Regards,
Ram.
Thanks Nicholaos anyway you had understood what my requirement finally . I hope may be i will find solution for this.
I was able to reproduce this. It has nothing to do with the other lookup (Site).
It seems that the lookup method of Warehouse is only executed one time: when the user clicks the lookup method for the first time. On further clicks the method is no longer executed, so perhaps it's cached somehow.
I don't have ideas how to fix it, or if it's somehow caused by some detail in your code.
The lookup method is expected to be executed every time when user clicks the lookup icon.
If your Warehouse lookup method is not executed after changing values in Site field (and clicking the Warehouse lookup icon), then it doesn't matter what code you have in it. The problem can't be fixed by changing contents of that method.
Do you happen to have any other code that would override the lookup method with something else? Or code that hides the original Warehouse field, and shows another Warehouse field instead?
Hi Nicholaos,
Here is my code i get the values for the lookup in the warehouse field from the site field control. So When i change the site field and then the warehouse fields lookup method will get hitted when i click the warehouse field . The value for the warehouse field will be filtered as per the value given in the site field. After changing value for the site field and then if i click the warehouse field , it doesn't hit the breakpoint in the lookup method. Sorry for the inconvenient description i have provided. Can you able to understand now.
Regards,
Ram.
public void lookup() { SysLookupMultiSelectCtrl slmsc; Query query; QueryBuildDataSource qbds; List list; ListIterator itr; list = new List(Types::String); list = strSplit(Site.valueStr(),";"); itr = new ListIterator(list); query = new Query(); qbds = query.addDataSource(tableNum(InventLocation)); qbds.fields().addField(fieldNum(InventLocation,InventLocationId)); qbds.fields().addField(fieldNum(InventLocation,InventSiteId)); if(Site.valueStr()!="") { while(itr.more()) { qbds.addRange(fieldNum(InventLocation, inventsiteid)).value(itr.value()); itr.next(); } } else { throw error('Please choose Site'); } slmsc = SysLookupMultiSelectCtrl::constructWithQuery(element,warehouse,query); super(); }
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,888 Super User 2024 Season 2
Martin Dráb 229,247 Most Valuable Professional
nmaenpaa 101,156