Pass date to External BAQ Function

This one isn’t as weird as some of mine :smiley: I have an external BAQ where I need to pass the Company (easy enough) and a user selected date. I can use a Defined Parameter in the BAQ, this does work, but I’d prefer it not prompt like that (hoping there’s an alternative to using a parameter). I know I could use a Dynamic Query Adapter and suppress the prompt, but I’d prefer to keep it in the Dashboard as much as possible (there’s a lot of view rules that won’t translate easily to a Dynamic Query Adapter)

Does anyone have suggestions on how I can have a simple date selecter in a tracker view, then pass that date to the underlying BAQ? There’s no date returned or visible in the BAQ columns, so I can’t use a standard date filter, I need to call the external BAQ (table valued function) with the date.

So since you are using an External BAQ already, you can do a bit of a cool hack, here’s the code you’ll need

CREATE VIEW AllDates AS
WITH DateCTE AS (
    SELECT CAST('1970-01-01' AS DATE) AS DateValue
    UNION ALL
    SELECT DATEADD(day, 1, DateValue)
    FROM DateCTE
    WHERE DateValue < DATEADD(day, -1, DATEFROMPARTS(YEAR(GETDATE()) + 1, 1, 1))
)
SELECT DateValue
FROM DateCTE

The video below walks through the rest

1 Like

The All Dates concept seems quite workable (and useful!), I really only need months, so I can reduce it some by just using the first and adding months. However, I’m not sure how to get the function parameter to be subscribed:


I’m trying to figure out how to get the @CurDate of the Function to be changed by the top BAQ. I can’t display a date in the lower BAQ to link.

This is all that is returned by the function, the date is an input parameter, but there’s no date on the output.

1 Like

Set a parameter in your BAQ then in your dashboard you create the subscription like I showed in the video.,

I don’t have the last 4 options in my execution settings?

ah!! you are in an older version of Epicor you can still do it but its going to require some clever(er) hacking.

Add this to your Date BAQ in the Execution Settings.

Thanks :slight_smile: that did the trick