Skip to main content
August 1, 2024
Solved

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

  • August 1, 2024
  • 2 replies
  • 0 views

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!

Best answer by Big_Rick_CPM

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. 

2 replies

August 1, 2024

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. 

August 1, 2024

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