Material Qeueu Filter

Created a filter for the material queue for our handlers. It hides all the backflush/automove operations, that have no value in the “Requested By” column, and only shows requests made by the work crew. You’ll have to create a checkbox on the queue screen. I named mine cbhide but you can use whatever works best for you.

Anyway, thought I would share:


 // **************************************************
// Custom code for MaterialQueueEntryForm
// Created: 3/5/2019 2:14:20 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using Infragistics.Shared;

public class Script
{
	// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
	// Begin Wizard Added Module Level Variables **

	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **

EpiUltraGrid gridmtl;

	public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

gridmtl = (Ice.Lib.Framework.EpiUltraGrid)csm.GetNativeControlReference("09bbac04-0c14-449b-9f99-b66bbf58dd6e");
	gridmtl.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.True;

		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		this.cbhide.CheckedChanged += new System.EventHandler(this.cbhide_CheckedChanged);

		// End Wizard Added Custom Method Calls
	}

	public void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		this.cbhide.CheckedChanged -= new System.EventHandler(this.cbhide_CheckedChanged);

		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal
	}

	private void cbhide_CheckedChanged(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **

		if (cbhide.Checked == true)  //filter if checked
			{
		        gridmtl.DisplayLayout.Bands[0].ColumnFilters["RequestedByEmpID"].FilterConditions.Add  (FilterComparisionOperator.NotEquals, "");
			}
		if (cbhide.Checked == false)
			{
			gridmtl.DisplayLayout.Bands[0].ColumnFilters["RequestedByEmpID"].FilterConditions.Clear();
			}
	}
}

Hopefully someone will find this useful. I know it helped our material handlers out.

3 Likes