Calling a BAQ From Application Studio Using Provider Model to Execute Dynamic Where Filters on the Server

By Bryan Spencer 

 

·      Create BAQ without parameters.  You will be sending where statements dynamically

·      In Application studio create a Grid panel object

·      Create a view in kinetic to hold your search values

·      Create a BAQ view pointing to the BAQ that we are working with.

At this point you should have 2 views one that has fields that will be mapped to controls to collect filter values and one that has all the fields that are returned from the BAQ.

 
 

Now it’s time to configure the grid. 

Navigate to the Provider Model and enter the BAQ ID. Then under Where List enter each filter that you would like to execute on the server.   

In this example “??” is the JavaScript nullish coalescing operator in this specific case the value will be ignored if the view field is null.  The remaining is standard syntax to send the value from a view field. 

The nice part about this is that Kinetic is smart enough to execute the baq again each time the field value changes in the filter view.   Nothing additional has to be done.

 
 

Once the grid is configured, connect controls to the filter view so as to collect values for sending to the server.  In this example I have two controls that are capturing a date range to the filter view.

 
 

Below is the trace showing where filters are being sent to the server as apart of the execution parameters.

 
Next
Next

Creating a File in Epicor Function and Downloading in Kinetic Client