Mass Issues to Manufacturing Customization

Hi everybody, I need a way to add fields from the JobAsmbl table to the Issue-List grid in the Mass Issues to Manufacturing module. We key in a job, check “Include Subassembles,” hit “Issue,” then the relevant data populates in the Issue-List window. We want to being in 6 additional columns, but 3 are user-defined. I believe the first 3 can be simply un-hidden in the customization settings, but how do we bring in the 3 user-defined fields?

What’s the Binding of that Grid?

Assm

Mtl, see image

Got it, you are going to have to either replace that grid or manually look up what you need in a customization. There are a few entries on here on how to do these (different ways)

2 Likes

Also Jose, I attempted the technique you explained in this thread: Grid Property Changed - #12 by josecgomez, but it wasn’t successful…we get this error shown in the image:

I’m not sure what its talking about regarding “Warehouse” but that error generally means there’s a wrong binding somewhere.
Is there a “Warehouse” column in your BAQ?

No, but I have “Warehse_WarehouseCode” in the BAQ, since that’s what the module appears to reference in the Field Help.

Here’s the custom code if it helps:

// **************************************************
// Custom code for MassIssueForm
// Created: 1/20/2021 3:37:41 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 Ice.Lib.Broadcast;


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 **
	BAQDataView baqViewMassIssue;

	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
		CreateMassIssueBAQView();
	}

	public void CreateMassIssueBAQView()
	{
		baqViewMassIssue = new BAQDataView("test_MassIssue");
		oTrans.Add("test_MassIssueBAQ",baqViewMassIssue);

		string pubBinding = "Job.JobNum";
		IPublisher pub = oTrans.GetPublisher(pubBinding);
		string pubBinding2 = "Assm.WarehouseCode";
		IPublisher pub2 = oTrans.GetPublisher(pubBinding2);
		if((pub == null)  || (pub2 == null))
		{
			oTrans.PublishColumnChange(pubBinding, "MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
			oTrans.PublishColumnChange(pubBinding2, "MyCustomPublish2");
			pub2 = oTrans.GetPublisher(pubBinding2);
			
		}	
	
		if((pub != null)  || (pub2!= null) )
			{	
				baqViewMassIssue.SubscribeToPublisher(pub.PublishName, "JobMtl_JobNum");
				baqViewMassIssue.SubscribeToPublisher(pub2.PublishName, "Warehse_WarehouseCode");
			}

	}

	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
	}
}

You are subscribing to two different Views? Job and Asm? You should pull the job form the Asm view too instead.

Did that, and I get this error when re-loading the form:

^ is this the name of the BAQ? if not, it should be. The parameter sent to the BAQDataView is the name of the BAQ>

Yes it is, correct capitalization too.

So as a follow up, I discovered another method to add the necessary columns directly to the Mtl EpiBinding…see code:

private void edvMtl_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
	// ** Argument Properties and Uses **
	// view.dataView[args.Row]["FieldName"]
	// args.Row, args.Column, args.Sender, args.NotifyType
	// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
	if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
	{
		if ((args.Row > -1))
		{
			if (!(edvMtl.dataView.Table.Columns.Contains("Width"))) 
			{
			edvMtl.dataView.Table.Columns.Add(new DataColumn("Width"));
			edvMtl.dataView.Table.Columns["Width"].ExtendedProperties["ReadOnly"] = true;
			}
			if (!(edvMtl.dataView.Table.Columns.Contains("Length"))) 
			{
			edvMtl.dataView.Table.Columns.Add(new DataColumn("Length"));
			edvMtl.dataView.Table.Columns["Length"].ExtendedProperties["ReadOnly"] = true;
			}
			if (!(edvMtl.dataView.Table.Columns.Contains("Thickness"))) 
			{
			edvMtl.dataView.Table.Columns.Add(new DataColumn("Thickness"));
			edvMtl.dataView.Table.Columns["Thickness"].ExtendedProperties["ReadOnly"] = true;
			}
			                      

		
		}
	}
}

Problem now is, how to populate the columns? There is data in the JobAsmbl table, can I link it through the Data Tools, or would it have to be coded directly also? Thanks for all your help so far!

Sure that ads the columns, then you have to find the information (usually a BAQ or an Adapter) to do the lookup then you loop through those results and update each column in your data view.

I would suggest a BAQ that contains the information you want, then run the BAQ to get the results

I did a customization a few years ago where I repurposed existing fields on the view I needed to modify to show information from other db table. Here is the link:

https://www.epiusers.help/t/add-ud-fields-from-other-bo-in-grid/53140/16?u=christian_pouchoulen

1 Like

I did a customization a few years ago where I repurposed existing fields on the view I needed to modify to show information from other db table. Here is the link:

https://www.epiusers.help/t/add-ud-fields-from-other-bo-in-grid/53140/16?u=christian_pouchoulen