BAQ Dataview linked to unbound controls?

here you go @NateS hope this helps

Here’s the code to go along with it

// **************************************************
// Custom code for UD103Form
// Created: 5/13/2021 11:15:16 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.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;

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 **
	DataTable dtpDupParts;
	EpiDataView dvDupParts;
	BAQDataView bdvFromPBInfo, bdvToPBInfo;

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

	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
	}
	public void SetupCustomDV()
	{
		dtpDupParts = new DataTable();
		var colFromPart = new DataColumn("FromPart");
		colFromPart.ExtendedProperties["Like"]="Part.PartNum";	
		dtpDupParts.Columns.Add(colFromPart);
		dtpDupParts.Columns.Add(new DataColumn("SysRowId",typeof(Guid)));
		
		var dr = dtpDupParts.NewRow();
		dr["SysRowId"] = Guid.NewGuid();
		dtpDupParts.Rows.Add(dr);

		dvDupParts = new EpiDataView();
		dvDupParts.dataView = dtpDupParts.DefaultView;
		oTrans.Add("TrackerView",dvDupParts);

		bdvFromPBInfo = new BAQDataView("PartDeDup_partbininfo");
		oTrans.Add("FromPartBinView",bdvFromPBInfo);

		var fromPBBinding= "TrackerView.FromPart";
		oTrans.PublishColumnChange(fromPBBinding,"FromPBPub");
		var fromPub = oTrans.GetPublisher(fromPBBinding);
		bdvFromPBInfo.SubscribeToPublisher(fromPub.PublishName,"PartBin_PartNum");
	}
}




6 Likes