Use a BR to Generate a SQL Statement within a Data Adapter

stribou
New Contributor II

Hi All - 

I am wondering if anyone can point me in the right direction on how to reference a business rule to generate the SQL statement within a data adapter for SQL / External type data adapter?

Any help would be greatly appreciated!

1 ACCEPTED SOLUTION

Big_Rick_CPM
Contributor

You are going to need to create a Dashboard Data Set business rule and reference that in the data adapter. A dashboard det set rule allows you to dynamically generate a SQL string using whatever logic you need and excute against any external data source you have connections to. The rule will return a data table/data set that your data adapter will use. When setting up the adapter, you will want to setup your adapter to be a "Method" command type refencing the business rule created. You can even parametrize the rule and pass arguments via name value pairs when calling the method.

I recommend reviewing the Application Reports(RPTA) marketplace solution for examples. 

View solution in original post

2 REPLIES 2

Big_Rick_CPM
Contributor

You are going to need to create a Dashboard Data Set business rule and reference that in the data adapter. A dashboard det set rule allows you to dynamically generate a SQL string using whatever logic you need and excute against any external data source you have connections to. The rule will return a data table/data set that your data adapter will use. When setting up the adapter, you will want to setup your adapter to be a "Method" command type refencing the business rule created. You can even parametrize the rule and pass arguments via name value pairs when calling the method.

I recommend reviewing the Application Reports(RPTA) marketplace solution for examples. 

MelindaLe
New Contributor II

Here are the screenshots to support Rick's recommendation:

MelindaLe_0-1722538916856.png

MelindaLe_2-1722539015558.png

If you want to view the output in a Dashboard report, you can create a Dashboard Component and add a Data Adapter.

MelindaLe_3-1722539463503.png