Use LINQ to query External BAQ in Server-side Configurator UD Method

,

Can’t for the life of me find the answer here. I have a client side method based on this post that I use to pass inputs as parameters into an external BAQ and return a DataSet, which I can use to populate certain fields in the configurator and UD fields in the OrderDtl table.

I’m working with adding orders via API call and triggering the Document Rules, but I can’t call a client-side method in the DocRules, so I’m trying to find a way to get this done.

I’ve got a SQL Table Value Function in my database that takes 2 parameters (OrderNum, OrderLine) and returns the results I want, but I can’t figure out how to access that function in Epicor. I also have an External BAQ connected to the View I need, and I have a Linq statement (below) that should do what I need, except I can’t figure out how to select from the BAQ.

var Rtrn = (from x in <my external query>
where x.Val1 >= myParam && x.Val2 <= myParam
select new { ID = x.ID, Score = ( <new calculated value> ) } );

Can anyone tell me how I can select from the external BAQ? Or, alternatively, if there’s a better way to do this?