Update epiShape based on value from field in Dashboard Panel

I’ve been trying a few different ways to get this to work, but can’t seem to find a good method. I have an epiShape on the Summary tab in Quote Entry that I want to Enable or Disable based on a field that is pulling in from an embedded dashboard on a custom sheet. Any thoughts or help with this would be appreciated.

What have you tried?

Form_Load, EpiViewNotification, maybe one or two others, but with no success. The problem I’m running into is that I don’t know how to trigger the status because I don’t really want to rely on some other process to trigger it. Basically, if there is a customer selected on the QuoteHed (either new or previously), I want the shape to be enabled if there is text in either of 2 fields from the embedded dashboard.

I think what you’re going to need to do is find a way to access the contents of that dashboard dataview first. As far as I know though, it’s a little tough to access the data inside of an embedded dashboard.
But if you get there, you’ll have a mechanism to compare to the QuoteHed data.

Let me play around with one and see how one might access that data.

1 Like

I’m thinking your best bet here (I’m sure someone else can solve the way described, but embedded dashboards are hard to work with) is to instead of using an embedded dashboard, create your own grid and populate it with a BAQ using the Dynamic Query Adapter. You would then have free access to the data populating the grid and you could still use the same BAQ as the current dashboard.

I’ve never done that before, but I’ll give it a try. Thanks. I’ll update with my results.

I have been trying to get this figured out, but can’t seem to find anything that shows how to build out a Dynamic Query Adapter and tie it to the EpiUltraGrid. Can you provide an example of how to do this?

So, I finally found something on YouTube, but when I went in to add the DynamicQueryAdapter, I don’t have it in my list. Do I need to add something, turn something on, or have some specific license? Any help is greatly appreciated!

What do you mean you don’t have it in your list?

I got that part all figured out thanks to the following link from @josecgomez

Now, I have 2 main issues:

  1. I have multiple lines in 2 of the fields that I want to view in the grid and am only pulling in 1 line at a time. Is there a way to allow multiple lines within each of those 2 fields?
  2. How do I access the 2 fields with multiple lines to verify that either one of the fields has some data in it to Enable my EpiShape?

Are you subscribing the BAQ to a dataview? That’s the only reason I can think that you’d be pulling 1 line at a time from your BAQ…
Can you put up some code so I have a reference point to what you’re doing? That would be helpful

I’m intentionally pulling only 1 line. we have 2 fields that we use per customer in case they have any special requirements that they request of us. I am matching the CustID and only want to pull 1 row. I want those 2 fields on just the 1 line to show multiple lines of text (within the 1 row), so it is easier to read the data rather than hovering over and trying to read the data without proper line formatting. Here is what I have so far. I only have 4 columns that return data into 1 row. I want 2 of the columns to expand vertically so that the text inside those 2 fields is easier to read (this is why we had the embedded dashboard before).

private void edvQuoteHed_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

	EpiTextBox txtCustomerIDValue = (EpiTextBox)csm.GetNativeControlReference("181615d5-f624-4f9b-ae67-0067592fc0e3");
	DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
	dqa.BOConnect();
	QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("TESTCustomerSpecialRequirement");
	qeds.ExecutionParameter.Clear();
	qeds.ExecutionParameter.AddExecutionParameterRow("CustIDParam", txtCustomerIDValue.Text, "nvarchar", false, Guid.NewGuid(), "A");
	dqa.ExecuteByID("TESTCustomerSpecialRequirement", qeds);
	epiUltraGridC1.DataSource = dqa.QueryResults.Tables["Results"];

}

Ok so you have the BAQ working, good. You get 1 row back (expected) but you want to split out 2 fields from that single row into two fields on your form?
Or are you wanting to change the size of the actual column in the grid?

Are you talking about binding the returned data to a particular custom field on the sheet? I never thought about doing that. How would I bind specific fields to a custom field if that is what you are referring to?

It’s probably not the most elegant solution, but you could just have two unbound fields on your form. When the data in the grid changes, you would set the value of the fields on your form to the appropriate column in your data. You could do this from the underlying datatable or from the grid itself

Example, if you have an unbound textbox, you’d set it like so

txtFormField1.Text = epiUltraGridC1.ActiveRow.Cells["yourcolumnKey"].Value.ToString();

If you’re getting the value direct from the query results dataset, it looks like this:

txtFormField1.Text = dqa.QueryResults.Tables["Results"].Rows[0]["YourBAQTable_YourBAQField"].ToString();

I have the BAQ data enabling and disabling my EpiShape now based on if there are any rows returned from the code supplied by @Marlon in the following post.

Now, I’m working through your code and testing. I’ll update shortly.

After testing, I got some errors when trying to use your 2 specific examples, so I ended up doing a foreach (even though I only have 1 row of data) from the following post to get the values to populate.

Also, I found that the formatting of the 2 text fields was just a continuous line and I needed carriage returns to be effective. I ended up keeping the embedded dashboard, but still used the dqa to determine if there was a resultant set of data and set the Enabled status of my EpiShape. Thank you so much for your help. I learned quite a bit through this process.

1 Like