Fill in labor qty in MES work queue, BPM or customization?

Ok, so I got it working. Here is the code for anyone interested.

// **************************************************
// Custom code for WorkQueueForm
// Created: 5/23/2016 11:46:30 AM
// **************************************************

extern alias Erp_Contracts_BO_EmpBasic;
extern alias Erp_Contracts_BO_ResourceGroup;
extern alias Erp_Contracts_BO_Resource;

using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.UI;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;

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 ActiveWorkGrid;
String QtyTransfer;
EpiButton SetLaborQtyButton;
int RowNum;


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

		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls


		// End Wizard Added Custom Method Calls
	
ActiveWorkGrid = (EpiUltraGrid)csm.GetNativeControlReference("0ab9e2d6-9433-4727-a6b8-730113cbe9a0");
SetLaborQtyButton = (EpiButton)csm.GetNativeControlReference("a7ea877b-9517-4dab-9273-4643af828ed6");
SetLaborQtyButton.Click += new EventHandler(NewLaborQty);
		
	}

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


		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal
SetLaborQtyButton.Click += new EventHandler(NewLaborQty);

	}

	private void NewLaborQty(object sender, EventArgs args)
	{
		// ** Place Event Handling Code Here **
		RowNum = -1;
		foreach(var row in ActiveWorkGrid.Rows)
		{
		RowNum = RowNum +1;
			if(row.Selected)
			{
			QtyTransfer = row.Cells["QtyLeft"].Value.ToString();
			ActiveWorkGrid.Rows[RowNum].Cells["LaborQty"].Value = QtyTransfer;
			}
		}
	}
}
1 Like