How do I create SQL Function BAQ's?

We just upgraded to 10.2.700 and I noticed a BAQ called zUsersSecGroupsForCompany that is only querying a SQL Table Value Function called Ice.UsersAndSecGroupsVisibleToCompanyFunc. There doesn’t seem to be anything in ZDataTable or ZDataField that references this function so how do I add a custom SQL Table Value function to a BAQ?

You can view all of the BAQ’s with Table Value Functions with: select * from ice.QueryTable where TableType=‘FN’

You need to create an External BAQ for that. Setup your external datasource, give company access to it and then do the following:

Create new ext baq to the (epicor db) datasource.

Click on the Table-Valued Functions, add epicor or your function and enter the call parameters.

Test.

Regards,
Carlos Q
PSE

1 Like

Thanks so much @carlosqt! Theirs isn’t marked as External, I was curious how they did that without making it an external BAQ? I thought that you had to create the ZData records in order for it to be recognized by a BAQ?

Also, do the custom functions stick around during major version upgrades? Thanks!

Apparently you can register SQL Views in BAQ Designer – there is no frontend for the User yet, but its coming.