Grid Property Changed

So the OrderNumber and th OrderLine is that coming from…? Order Entry? What form are you on so I can provide a bit better example.

I am on a customized Dashboard. This particular grid is using a BAQ I call. It uses the parameters of Order Number and Order line which come from and Order BAQ in my dashboard.

Got it, if you are already in a dashboard any reason why you can’t use a Publish Subscribe Grid / Tracker? In the Original Dashboard? That is reference your GS_UD09_Movement_All BAQ in your original dashboard and subscribe it to the Top Grid… so when the top grid changes… the bottom one does too… Requires no code…
(If I’m understanding correctly)

Yes, I could do that. However, I decided not to because I need to be able to place the tab/grid that it would create in a particular location. If I put it on the main dashboard I can’t move it to a different sheet…unless you would know how to do that…
So in order to have control of my layout I have resorted to Dynamic Queries that call my BAQ’s and I can put them in grids wherever I want.

Or if there is someway to hide the tab that the Grid/Tracker would create in the Dashboard?

ok… I mean you could still do it in a customization but fair enough. Then I suggest you use the BAQDataView method I’ll try to outline it below
Here is a video I made which does exactly this on a regular form not a doashboard but the same concept applies…

In your Case you’ll be publishing the original BAQ Columns OrderNum and OrderLine

Then subscribing your BAQDataView to these. If you watch the video I think you’ll get the gist of it… Here is the Post which explains further

You’ll have to remove the paramters from your GS_UD09_Movement_All and make sure that OrdereNum and OrderLine are in the BAQ Results, then the “filtering” will happen “magically”

Let me know if you run into issues and I’ll try to provide more detail.

PS: In my example above I’m only subscribing to one column, but to do two columns all you have to do is repeat the Publisher and the Subcribe… as follows (below I’m subscribing to changes to Year_c and or Type_c

void CreateBAQView() {
// create the baq view and add it to the transaction
bdvLeaveUsage = new BAQDataView("Payroll-Cust-LeaveUsage");
oTrans.Add("LeaveUsageView", bdvLeaveUsage);
 
// publish columns we'll bind to
var yearBinding = "UD100View.Year_c";
var typeBinding = "UD100View.Type_c";
 
oTrans.PublishColumnChange(yearBinding, Guid.NewGuid().ToString());
oTrans.PublishColumnChange(typeBinding, Guid.NewGuid().ToString());
var yearPub = oTrans.GetPublisher(yearBinding);
var typePub = oTrans.GetPublisher(typeBinding);
 
// subscribe our BAQ view
// NOTE: In E10 field names use the format with an underscore. will no longer work.
bdvLeaveUsage.SubscribeToPublisher(yearPub.PublishName, "Calculated_PayRollYear");
bdvLeaveUsage.SubscribeToPublisher(typePub.PublishName, "LaborDtl_IndirectCode");
 

}
3 Likes

That is amazing! So my only question would be…will this slow the load of the dashboard down since you load the view at initialize? Do you have to do it at initialize? I’m assuming you do because that is the only way to bind it to a grid. What is the benefit of a Dynamic Query vs. a BAQ View?

Also, on a side note…you are like the Go To guy here while we are implementing our Epicor lol. We have all watched your videos :):smiley:

It shouldn’t slow anything down since your are subscribing it to the top view, it will only run once there’s something to filter against.
and thanks glad I could help

Okay great. So I have a ton of Dynamic Queries running currently on a text box leave. Do you think it would be more beneficial to change those to BAQ DAta Views?

Also, do you ever do any consulting for people in the middle of Epicor Implementation? Not sure if that is okay to ask on here or not.

My motto is when you can use EpiMagic… do… you get a ton of benefits. So yes I think it would be beneficial. Ask @Chris_Conn I’m all about the EpiMagic… and I drilled it into his head… (note he still doesn’t listen… but I try)

I don’t do consulting these days, trying to stay out of the consulting world. If you’d like me to recommend some help I can certainly do that off the forum I know some good folks all over the place. Let me know and i’ll shoot you an email with some recommendations.

1 Like

These are all facts. :stuck_out_tongue:
Seriously though, there are 20 ways to skin a cat:
10 seem to work
6 work OK
3 are acceptable
1 is right

Generally speaking, @josecgomez will offer the 1.

1 Like

Can you email me at “email redacted for your own protection” and I can email you what we are looking for.

1 Like

Hahah Jose just saved your life!

Ha seems he saves a lot of lives… and so do you @Chris_Conn!

2 Likes

@josecgomez
How would I refresh that DataView I just created?

You shouldn’t have to, it subscribes to the top grid and when you change the top grid it automatically re-runs the query. However if you want to force it to refresh (IE you add more data somewhere else) you can do this

//Add this using at the top of your class
using System.Reflection;

//On "Refresh" or button click
MethodInfo mi = bdvLeaveUsage.GetType().GetMethod("invokeExecute", BindingFlags.Instance | BindingFlags.NonPublic);
mi.Invoke(bdvLeaveUsage, new object[]{ true });
5 Likes

Okay I have a very weird issue going on. I made a BAQ Data View from all the code we talked about. That is working fine. I bound a text field to one of the columns in the Data View. I have an if statement that performs if this or that. However, the if statement only works if I have a message box in there. If I comment out the Message Box it quits working. What in the world is going on?

	{
	GS_UD09_Movement_DataView = new BAQDataView("GS_UD09_Movement_DataView");
	oTrans.Add("GS_UD09_Movement_DataView", GS_UD09_Movement_DataView);
	var OrderNum = "V_GS_Order_Detail_All_1View.OrderDtl_OrderNum";
	var OrderLine = "V_GS_Order_Detail_All_1View.OrderDtl_OrderLine";
	oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
	oTrans.PublishColumnChange(OrderLine, Guid.NewGuid().ToString());
	var OrderNumPub = oTrans.GetPublisher(OrderNum);
	var OrderLinePub = oTrans.GetPublisher(OrderLine);
	GS_UD09_Movement_DataView.SubscribeToPublisher(OrderNumPub.PublishName, "UD091_Number01");
	GS_UD09_Movement_DataView.SubscribeToPublisher(OrderLinePub.PublishName, "UD091_Number02");
	}	

// This is the if then statement that only works if I leave the Message Box active

	{
				MessageBox.Show(tbMovementToDept.Text);
				if (tbMovementToDept.Text == "99")
				{
					//MessageBox.Show("Dept. 99" + " Move " + tbMovementToDept.Text);
					btnShipstore.Visible = true;
					btnCreateNon_Conformance.Visible = true;	
				}
			else
				{
					//MessageBox.Show("Not Dept. 99" + tbMovementToDept.Text);
					btnShipstore.Visible = false;
					btnCreateNon_Conformance.Visible = false;
				}
			}```

//I call Dept99(); here:
```//Order - On Leave Refreshes the View and Grids
	private void numOrderDtl_OrderNum_Leave(object sender, System.EventArgs args)
		{
		if (numOrderDtl_OrderNum.Value.ToString() == ("0"))
			{
		MessageBox.Show("Please enter more job information to search.");
			}
			else
			{
			txtOrderHed_PONum.Text = string.Empty;
			epiNumericOrderNumRef.Value = numOrderDtl_OrderNum.Value;
			numOrderDtl_OrderLine.Value = (1);
			epiNumericEditorOrderLineNo.Value = numOrderDtl_OrderLine.Value;
			DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
			dqa.BOConnect();
			QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Order_Detail_Params");
			qeds.ExecutionParameter.Clear();
			qeds.ExecutionParameter.AddExecutionParameterRow("OrderNum", epiNumericOrderNumRef.Value.ToString() , "nvarchar", false, Guid.NewGuid(), "A");
			qeds.ExecutionParameter.AddExecutionParameterRow("OrderLine", epiNumericEditorOrderLineNo.Value.ToString() , "nvarchar", false, Guid.NewGuid(), "A");
			dqa.ExecuteByID("GS_Order_Detail_Params", qeds);
			grid_OrderDetails.DataSource = dqa.QueryResults.Tables["Results"];
			edvV_GS_Order_Detail_All_1View.ResetDataView(dqa.QueryResults.Tables["Results"].DefaultView);
    		edvV_GS_Order_Detail_All_1View.Notify(new EpiNotifyArgs(oTrans, 0, EpiTransaction.NotifyType.Initialize));
			changeordernumber();	
			MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));		
			Dept99();		
			}
		}

I’m confused if you are using the BAQDataView why are you executing a BAQ manually?

When does that if statement get called?

What do you mean executing the BAQ manually? The if statement gets called at the end of the change order number. Those are other Dynamic BAQ’s I haven’t converted yet.