Changed a grid in Customer Tracker, how do I get the Retrieve button working?

Hello,
I followed the instructions that Jose posted in another area https://epiusers.help/t/efficiently-adding-column-to-datagrid/36283/5.
I created a replacement for the Customer Tracker ‘Service->All’ tab.
It works fine except for 2 things, neither a deal breaker:

  1. The Retrieve button doesn’t work
  2. It auto populates instead of waiting for the retrieve button.

I know the old button is linked to the old grid view. I just haven’t done anything with buttons before so was looking for some guidance on how to set up a new button.

Also, once the button works, how to I turn off the auto populate of the grid?

My alternative if no one can help is to just delete the existing button and let it auto-populate but I would like it to match the other tabs next to it in functionality.

I would like to thank everyone here again for having such a great community! I love this site.

You could change your subscsribe to subscribe from the “old” dataview that theg rid was attached to and that should cause the BAQVIew to not treive until it has been populated.

1 Like

I am not sure what you are saying.
The old databinding was called ‘ServAll’

My code is:

public void CreateServiceAllBAQView(){
baqViewServiceAll = new BAQDataView(“CustTrackerServAllReplacement”);
oTrans.Add(“ServReplaceBAQ”,baqViewServiceAll);

	string pubBinding = "Customer.CustID";
	IPublisher pub = oTrans.GetPublisher(pubBinding);
	if(pub==null){
		oTrans.PublishColumnChange(pubBinding, "MyCustomPublish");
		pub = oTrans.GetPublisher(pubBinding);
	}
	if(pub != null)
		baqViewServiceAll.SubscribeToPublisher(pub.PublishName, "Customer_CustID");
}

What would I change?

Change this to come out of the “old” EpiDataView that was bound to the grid
“MyOldIVew.CustID”

1 Like

I’m sorry if I sound dense, but how would I find out what the old view binding was?

If you open the “BASE” customization and click on the grid you should be able to see what it was bound to: ServAll

Looking through the columns in that ServAll dataview, I see there is indeed a CustID column

So changing your

To

string pubBinding = "ServAll.CustID";

Might do the trick, let me know if that works (I haven’t tested it)

2 Likes

That was the first thing I tried when you suggested it. I was hoping I was mistaken.
It didn’t work for me.
It doesn’t populate the grid anymore, clicking the retrieve button doesn’t bring it back.
Maybe that is my issue. Should the original Retrieve button work after this change or will I need to somehow create a new one?

So CustID is blank in that grid… cause #Epicor… change your query to use CustNum and try again

1 Like

Yup that works

I used this

public void CreateServiceAllBAQView()
	{
		baqViewServiceAll = new BAQDataView("CIDTEST");
		oTrans.Add("ServReplaceBAQ",baqViewServiceAll);

		string pubBinding = "ServAll.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);
		if(pub==null){
			oTrans.PublishColumnChange(pubBinding, "MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}
		if(pub != null)
			baqViewServiceAll.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");
	}
4 Likes

That worked like a charm!
Thanks for walking me through it.
Now that I got a grasp on what you did to make it work, I will write it all down so I don’t make the same mistake.

I will make new ones!! lol

I appreciate you taking time out of your day to help people like me.
Thanks,
Shawn

1 Like

Jose,

At my wits end. I was asked to add a field to multiple tabs on the Customer Tracker and found these instructions that worked quite well for the tabs under Orders but I cannot get the same functionality to work under the RMA tab (or the Shipments tab for that matter. Any idea what I am missing?

// **************************************************
// Custom code for CustomerTrackerForm
// Created: 5/20/2019 4:11:57 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.BO;
using Ice.Lib.Broadcast;
using System.Reflection;
using Infragistics.Win.UltraWinGrid;
using Ice.Contracts;



 

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 baqViewOpen;
	BAQDataView baqViewAll;
	BAQDataView baqViewClosed;
	BAQDataView baqViewByShipTo;
	BAQDataView baqViewOpenRMAs;
	BAQDataView baqViewClosedRMAs;
	BAQDataView baqViewAllRMAs;
	BAQDataView baqViewShipmentAll;
	BAQDataView baqViewShipmentByOrder;
	BAQDataView baqViewShipmentByShipTo;
	BAQDataView baqViewShipmentPending;
	BAQDataView baqViewShipmentShippedNotInv;
	BAQDataView baqViewShipmentsShipped;

	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

	EpiUltraGrid openOrder = (EpiUltraGrid)csm.GetNativeControlReference("741857dd-a984-45d3-ad73-94903e9abcd2");
	openOrder.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;
	
	EpiUltraGrid ordersClsd = (EpiUltraGrid)csm.GetNativeControlReference("ca727e28-853a-43f7-a0c3-9cd513173542");
	ordersClsd.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid orderAll = (EpiUltraGrid)csm.GetNativeControlReference("e181f218-48bf-4686-a199-ff2cf4b91bae");
	orderAll.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid orderByShpTo = (EpiUltraGrid)csm.GetNativeControlReference("084c0f8f-bb23-42a5-ac9e-cc0c454646a9");
	orderByShpTo.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid opnRMA = (EpiUltraGrid)csm.GetNativeControlReference("18c1a629-e7f0-46c5-8d84-53d161d03a62");
	opnRMA.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid clsdRMA = (EpiUltraGrid)csm.GetNativeControlReference("6d72c36d-0c8b-49c6-9548-03f776e85cd7");
	clsdRMA.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid allRMA = (EpiUltraGrid)csm.GetNativeControlReference("a7f94ad4-9c6d-4ea5-a3d3-c677e6d2b6e0");
	allRMA.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid shipmntAll = (EpiUltraGrid)csm.GetNativeControlReference("a7f94ad4-9c6d-4ea5-a3d3-c677e6d2b6e0");
	shipmntAll.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid shipByOrd = (EpiUltraGrid)csm.GetNativeControlReference("58b1c370-52fa-4073-866c-00b0c30c6667");
	shipByOrd.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid shpByShpTo = (EpiUltraGrid)csm.GetNativeControlReference("149d8e45-95e4-464b-b708-0089fdc4f536");
	shpByShpTo.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid shpPend = (EpiUltraGrid)csm.GetNativeControlReference("e0f2910a-6cf1-4ffe-80c6-48f692a29a7b");
	shpPend.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;

	EpiUltraGrid shpNotInv = (EpiUltraGrid)csm.GetNativeControlReference("96bbe5c7-7bc1-47b9-945a-c2e2b715b31d");
	shpNotInv.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.SortMulti;



		// End Wizard Added Custom Method Calls
		CreateOpenBAQView();
		CreateAllOrdersBAQView();
		CreateClosedOrdersBAQView();
		CreateOrdersByShipToBAQView();
		CreateOpenRMAsBAQView();
		CreateAllRMAsBAQView();
		CreateClosedRMAsBAQView();
		CreateShipmentAllBAQView();
		CreateShipmentByOrderBAQView();
		CreateShipmentByShipToBAQView();
		CreateShipmentPendingBAQView();
		CreateShipmentShippedNotInvBAQView();
		CreateShipmentsShippedBAQView();


	}
//////////////////////////////////////////////////////////////
	public void CreateOpenBAQView()
	{
		baqViewOpen = new BAQDataView("CustTrkOpenOrders");
		oTrans.Add("OpenOrdersBAQ",baqViewOpen);

		string pubBinding = "OrderOpen.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewOpen.SubscribeToPublisher(pub.PublishName, "OrderHed_CustNum");



	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	public void CreateAllOrdersBAQView()
	{
		baqViewAll = new BAQDataView("CustTrkAllOrders");
		oTrans.Add("AllOrdersBAQ",baqViewAll);

		string pubBinding = "OrderAll.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}

		if(pub !=null)
			baqViewAll.SubscribeToPublisher(pub.PublishName, "OrderHed_CustNum");

	}


	public void CreateClosedOrdersBAQView()
	{
		baqViewClosed = new BAQDataView("zCustTrackerOrdersClosed");
		oTrans.Add("ClosedOrdersBAQ",baqViewClosed);

		string pubBinding = "OrderClose.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewClosed.SubscribeToPublisher(pub.PublishName, "OrderHed_CustNum");

	}

	public void CreateOrdersByShipToBAQView()
	{
		baqViewByShipTo = new BAQDataView("CustTrkOrderByShipTo");
		oTrans.Add("OrdersByShipToBAQ",baqViewByShipTo);

		string pubBinding = "OrderSite.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewByShipTo.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");
	}


/////////////////////////////////////////////////////

	public void CreateAllRMAsBAQView()
	{
		baqViewAllRMAs = new BAQDataView("zCustTrackerRMAsBAQ");
		oTrans.Add("AllRMAsBAQ",baqViewAllRMAs);

		string pubBinding = "RMAAll.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewAllRMAs.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");

	}

	public void CreateOpenRMAsBAQView()
	{
		baqViewOpenRMAs = new BAQDataView("zCustTrackerOpenRMAsBAQ");
		oTrans.Add("OpenRMAsBAQ",baqViewOpenRMAs);

		string pubBinding = "RMAOpen.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewOpenRMAs.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");

	}



	public void CreateClosedRMAsBAQView()
	{
		baqViewClosedRMAs = new BAQDataView("zCustTrackerClosedRMAsBAQ");
		oTrans.Add("ClosedRMAsBAQ",baqViewClosedRMAs);

		string pubBinding = "RMAClose.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewClosedRMAs.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");

	}


/////////////////////////////////////////////////////////////////////////////

	public void CreateShipmentAllBAQView()
	{
		baqViewShipmentAll = new BAQDataView("zCustTrackerShipmentAll");
		oTrans.Add("ShipmentsAllBAQ",baqViewShipmentAll);

		string pubBinding = "ShipAll.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewShipmentAll.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");

	}

//
	public void CreateShipmentByOrderBAQView()
	{
		baqViewShipmentByOrder = new BAQDataView("zCustTrackerShipmentByOrder");
		oTrans.Add("ShipmentsByOrderBAQ",baqViewShipmentByOrder);

		string pubBinding = "ShipOrd.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewShipmentByOrder.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");

	}


	public void CreateShipmentByShipToBAQView()
	{
		baqViewShipmentByShipTo = new BAQDataView("zCustTrackerShipmentByShipTo");
		oTrans.Add("ShipmentsByShipToBAQ",baqViewShipmentByShipTo);

		string pubBinding = "ShipSite.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewShipmentByShipTo.SubscribeToPublisher(pub.PublishName, "ShipDtl_CustNum");

	}

//
	public void CreateShipmentPendingBAQView()
	{
		baqViewShipmentPending = new BAQDataView("zCustTrackerShipmentPending");
		oTrans.Add("ShipmentsPendingBAQ",baqViewShipmentPending);

		string pubBinding = "ShipPend.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewShipmentPending.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");

	}

//
	public void CreateShipmentShippedNotInvBAQView()
	{
		baqViewShipmentShippedNotInv = new BAQDataView("zCustTrackerShipmentShippedNot");
		oTrans.Add("ShippedNotInvBAQ",baqViewShipmentShippedNotInv);

		string pubBinding = "ShipNotInv.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewShipmentShippedNotInv.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");

	}

//
	public void CreateShipmentsShippedBAQView()
	{
		baqViewShipmentsShipped = new BAQDataView("zCustTrackerShipmentsShipped");
		oTrans.Add("ShippedBAQ",baqViewShipmentsShipped);

		string pubBinding = "ShipShpd.CustNum";
		var pub = oTrans.GetPublisher(pubBinding);

		if (pub==null)
		{
			oTrans.PublishColumnChange(pubBinding,"MyCustomPublish");
			pub = oTrans.GetPublisher(pubBinding);
		}


		if(pub !=null)
			baqViewShipmentsShipped.SubscribeToPublisher(pub.PublishName, "Customer_CustNum");

	}




//----Customer Tracker List BAQ's
//CustTrkOpenOrders
//CustTrkAllOrders
//zCustTrackerOrdersClosed
//CustTrkOrderByShipTo
//zCustTrackerRMAsBAQ
//zCustTrackerOpenRMAsBAQ
//zCustTrackerClosedRMAsBAQ
//zCustTrackerShipmentAll
//zCustTrackerShipmentByOrder
//zCustTrackerShipmentByShipTo
//zCustTrackerShipmentPending
//zCustTrackerShipmentShippedNot
//zCustTrackerShipmentsShipped

A little guidance on “it’s not working” would be helpful
What is not working? You posted a bunch of code but I can’t just go through all that without some sense of what the issues are.
What are you trying to do (end goal?)
How are you trying to do it?
What’s the error or issue you are encountering?

My apologies,

The request was made to add an additional (custom) field to different tabs on the Customer Tracker and not have them refresh the data until the retrieve button was clicked.

For each tab, I built a separate BAQ and created a view for each of the requested tabs with the initial EpiBinding pointing to the original binding to allow the grid to be created upon initialization without pulling data on the pubBinding change until the “Retrieve” button was clicked.

After finding this solution under " Changed a grid in Customer Tracker, how do I get the Retrieve button working" I modified each of the CreateBAQView segments by setting the string pubBinding to the original epiBinding and changing the IPublish to var as described in your answer to shobdy.

After doing so, the tabs under Customer - Orders (Open, Closed, All and By Ship To) worked beautifully and returned data after clicking the “Retrieve” tab as described.

The Tabs under RMA’s and Shipments, however, are returning no data on the “Retrieve” button click.

I know it’s a lot to unpack as there a multiple tabs and multiple queries but I was thinking that the same process would work on each of them.

Any assistance that you can provide would be greatly appreciated.

Johnny