Possible solution for silent BAQ parameter passing (working now)

Hmm… UD tables should also be indexed by their keys though…. right?

Regards,
Chris Were

probably

Loving the UD05 solution for now!

Just took a BAQ I struggled for weeks on, had 5 inner subqueries aggregating numbers from 5 different tables/conditions, and previously used 2 BAQ Params for specify the Period Start and End the aggregations ran over. Every time you did ANYTHING in the dashboard or custom Kinetic App I created with app wizard, you’d get the parmeter input slider appear.

Now just added a DateRange key to UD05 Key1, add another UD05 innersubquery to the report, and and doing my range filtering so:

The UD05_DateRange subquery:

@Chrisw we found an interesting method were we used a function//dynamic query combo. It’s works really well and can be repurposed / reused.

Here’s the link:
How to: BAQ parameter dashboards

Hope this helps.

1 Like

That’s cool Alex, and a great description thanks. I see how the button calls the function, the function calls the baq get with parameters supplied and replaces the dataview content.

Does it prevent the Baq triggering its parameter popups if you sort by column/filter/or group on the results grid?

With the grid provided by the dataview, dataview linked to the baq still, it looks like it might still trigger the baq parameter input popups if the user interacts with the grid view? UPDATE looks like it won’t, is that because the Provider Model references the dataview only, and not the BAQ in its params? (When i created my application using app wizard it assigned both)

I’ll try a simple one with a single parameter function here.

Functions! New fun. :slight_smile:

Hi @ridgea I tried to follow your model, simplified for now to just pass a single parameter (CustNum) but tripped at entering the code, its giving me syntax errors (this my first attempt at any code in epicor btw, forgive me if I missed something obvious):

UPDATE, nevermind found it I think:

image


original errors:

System.Drawing.Bitmap CS0234 The type or namespace name ‘DynamicQuerySvcContract’ does not exist in the namespace ‘Ice.Contracts’ (are you missing an assembly reference?)
System.Drawing.Bitmap CS0234 The type or namespace name ‘QueryExecutionTableset’ does not exist in the namespace ‘Ice.Tablesets’ (are you missing an assembly reference?)
System.Drawing.Bitmap CS0246 The type or namespace name ‘QueryExecutionTableset’ could not be found (are you missing a using directive or an assembly reference?)
System.Drawing.Bitmap CS0246 The type or namespace name ‘ExecutionParameterRow’ could not be found (are you missing a using directive or an assembly reference?)
System.Drawing.Bitmap CS0246 The type or namespace name ‘ExecutionParameterRow’ could not be found (are you missing a using directive or an assembly reference?)

My Code (basically yours):

CallService<Ice.Contracts.DynamicQuerySvcContract>(dQ =>
{
  // Create a new instance of QueryExecutionTableset 
  Ice.Tablesets.QueryExecutionTableset dsQueryExecution = new QueryExecutionTableset();
  
  // Create a new ExecutionParameterRow for the 'CustNum' parameter
  ExecutionParameterRow drRow = null;
  drRow = new ExecutionParameterRow();
  drRow.ParameterID = "CustNum";
  drRow.ParameterValue = this.CustNum;
  drRow.ValueType = "nvarchar";
  drRow.IsEmpty = String.IsNullOrEmpty(this.CustNum);
  drRow.RowMod = "A";
  drRow.SysRowID = new Guid();
  
  // Add the 'CustNum' parameter to dsQueryExecution
  dsQueryExecution.ExecutionParameter.Add(drRow);
  
  // Execute the query using the BaqID and dsQueryExecution
  this.returnObj = dQ.ExecuteByID(this.BaqID, dsQueryExecution);
});

Usings tab:

using Epicor.Customization.Bpm;
using Epicor.Data;
using Epicor.Hosting;
using Epicor.Utilities;
using Erp;
using Erp.Tables;
using Ice;
using Ice.Contracts;
using Ice.ExtendedData;
using Ice.Tables;
using Ice.Tablesets;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;

Nicely done !

Yeah by binding the data view to the grid model the UI grid doesn’t execute the query upon initialization ( like if the BAQ was the bound datasource.

Another benefit is you get around the paging affect within the UI.

@ridgea Can you explain this a little more? Because I am still getting the slideout.

I followed your PDF here, and I did indeed succeed in getting the BAQ to run without me (the human user) needing to enter anything. But the slideout still appears when I expand un unrelated panel card. See GIF below.

BAQparamWindow

For the event, I actually hard-coded the input to the BAQ (well, the EFx that then runs the BAQ), but I mean, I could tie it to an input box or something.

Thanks in advance.

Hi @JasonMcD ,

Sorry, been a tad busy lately.

Interesting, I assume you are ultimately trying to 1. Get a list of trucks / trailers then 2. Run you exploded BOM for that particular truck?

Also did you add the parametrized BAQ in when initially creating the dashboard or did you add it via Application studio ?

No problem.

Yes, exactly.

Added later. It started with just the “List of trucks and trailers” BAQ, which I published. Then I went into app studio to add the parameterized BAQ.

That’s cool, I just wanted to check, is the top panel a BAQ with a parameter ?

I’ve re-looking at it in dev and i can’t seem to replicate the issue to see what could be causing it.

Feel free to pack it up in a solution and ill see if i can take a look when i get a spare 5.