I want to know if it’s possible to call a BAQ from custom code that uses EpiBinding.
i know that creating a parameter for the BAQ could solve the problem, but i want to avoid having to maintain 2 BAQ that do the same thing.
BAQDataView bdvLeaveUsage;
private void CreateBAQView() {
// create the baq view and add it to the transaction
bdvLeaveUsage = new BAQDataView("Payroll-Cust-LeaveUsage");
oTrans.Add("LeaveUsageView", bdvLeaveUsage);
// publish columns we'll bind to
var yearBinding = "UD01.Year_c";
var typeBinding = "UD01.Type_c";
oTrans.PublishColumnChange(yearBinding, Guid.NewGuid().ToString());
oTrans.PublishColumnChange(typeBinding, Guid.NewGuid().ToString());
var yearPub = oTrans.GetPublisher(yearBinding);
var typePub = oTrans.GetPublisher(typeBinding);
// subscribe our BAQ view
// NOTE: In E10 field names use the format with an underscore. will no longer work.
bdvLeaveUsage.SubscribeToPublisher(yearPub.PublishName, "Calculated_PayRollYear");
//Oh yeah this thing takes another param (string) called a condition ... SQL condition that is... so pass in
//"=" or "like" or "begins" IE
bdvLeaveUsage.SubscribeToPublisher(typePub.PublishName, "LaborDtl_IndirectCode", "like");
}