Filter Unselected View in Material Request Queue

Hi,

I need to filter out the rows where TranType is like “STK-SHP” and Priority = 5. The 10.1 retrieved the data on load, now we are on 10.2 and Epicor added the Retrieve button. The fun fact is that the filter added to the MaterialQueueEntryForm_Load event handler still works when the retrieve button is pressed. So when:

private void MaterialQueueEntryForm_Load(object sender, EventArgs args)
{
EpiDataView edvUnselected = ((EpiDataView)(this.oTrans.EpiDataViews[“Unselected”]));
edvUnselected.AdditionalFilter = “Priority = 5 AND TranType LIKE ‘%STK-SHP%’”;
}

the only row which appear is STK-SHP with priority 5. When I change it to “Priority < 5 AND TranType NOT LIKE ‘%STK-SHP%’” the filter does not work, SIC!

Could you advise me on the best method to filter the data view, please?

Kind regards
Aleksander

Did you try this?

Priority < 5 AND TranType <> 'STK-SHP'

Yes, Jason

Brings back nothing. This is one reason I asked for help. The behaviour is inconsistent. I tired NOT LIKE as well :frowning:
The other question I have is why the on load works after pressing retrive button?

Reagrds
Alek

I’ve added a couple of buttons to the side of the grid. It’s filtering the grid itself:

private void btnFilterSTKSTK_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		
		EpiUltraGrid ultraGridMtlQueue = (EpiUltraGrid)csm.GetNativeControlReference("09bbac04-0c14-449b-9f99-b66bbf58dd6e"); 
	   
		ultraGridMtlQueue.DisplayLayout.Bands[0].ColumnFilters["TranType"].FilterConditions.Clear();		
		ultraGridMtlQueue.DisplayLayout.Bands[0].ColumnFilters["TranType"].FilterConditions.Add(FilterComparisionOperator.Equals, "STK-STK");	
		
	}

	private void btnFilterSTKSHP_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		
		EpiUltraGrid ultraGridMtlQueue = (EpiUltraGrid)csm.GetNativeControlReference("09bbac04-0c14-449b-9f99-b66bbf58dd6e"); 
	   
		ultraGridMtlQueue.DisplayLayout.Bands[0].ColumnFilters["TranType"].FilterConditions.Clear();				
		ultraGridMtlQueue.DisplayLayout.Bands[0].ColumnFilters["TranType"].FilterConditions.Add(FilterComparisionOperator.Equals, "STK-SHP");
			
	}

	private void btnFilterALL_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		EpiUltraGrid ultraGridMtlQueue = (EpiUltraGrid)csm.GetNativeControlReference("09bbac04-0c14-449b-9f99-b66bbf58dd6e"); 
	   
		ultraGridMtlQueue.DisplayLayout.Bands[0].ColumnFilters["TranType"].FilterConditions.Clear();		
		
	}
2 Likes

Did you try AND NOT TranType LIKE?

Hi Daryl,

Still does not work :(. Displays nothing.

Regards
Alek

Hi Mark,

With column filter I would need to add a new “hidden” column where I would concat Priority and Tran Type and the filter on new that new column.

Not a very elegant solution and I will try all other possibilities before running into solutions like that.

Thank you
Aleksander

I think you could just add another line like this

ultraGridMtlQueue.DisplayLayout.Bands[0].ColumnFilters["TranType"].FilterConditions.Add(FilterComparisionOperator.Equals, "STK-STK");	ultraGridMtlQueue.DisplayLayout.Bands[0].ColumnFilters["Priority"].FilterConditions.Add(FilterComparisionOperator.Equals, "HIGH");	
1 Like

I was able to use the samples provided as a base to write code to filter by job number. Thanks everyone!