Bartender, Auto Print and Call Context

Having a bit of an issue with the number of lines in an Epicor 10 Data Directive that produces bartender files. If I use a constant print quantity on the report options I get one line per the constant value, if I use a CallContextBPMData number it only creates one line. Any help would be appreciated as to why it does not print the correct amount of rows.

Details below

Data Directive - BPM
image

Condition

JobOper.OpCode = string constant and OpComplete = true

Auto Print setup
image

Send E-mail
image

Outcome

Email contents

Call Context Number01 : 123

Outcome

Bartender file has single data line
%BTW% /AF="[\BARTENDER\Labels\EpicorTest\XXXX.BTW](file://bartender/Labels/EpicorTest/XXXX.BTW)" /D="" /PRN="[\BARTENDER](file://bartender/)XXXX" /DBTEXTHEADER=3 /R=3 /P

%END%

“_JobHead_RptLanguageID”,"_JobHead_Company","_JobHead_ContractID","_JobHead_JobNum","_JobHead_PartNum","_JobHead_QtyCompleted","_JobHead_EOL_ExpiryDate_c","_JobHead_Calc_COOQtyPerc01","_JobHead_Calc_COOQtyPerc02","_JobHead_Calc_COOQtyPerc03","_JobHead_Calc_COOQtyPerc04","_JobHead_Calc_COOQtyPerc05","_JobHead_Calc_COOQtyPerc06","_JobHead_Calc_COOQtyPerc07","_JobHead_Calc_COOQtyPerc08","_JobHead_Calc_COOQtyPerc09","_JobHead_Calc_COOQtyPerc10","_JobHead_Calc_COOQtyPerc11","_JobHead_Calc_COOQtyPerc12","_JobHead_Calc_COOQtyPerc13","_JobHead_Calc_COOQtyPerc14","_JobHead_Calc_COOQtyPerc15","_JobHead_Calc_COOValuePerc01","_JobHead_Calc_COOValuePerc02","_JobHead_Calc_COOValuePerc03","_JobHead_Calc_COOValuePerc04","_JobHead_Calc_COOValuePerc05","_JobHead_Calc_COOValuePerc06","_JobHead_Calc_COOValuePerc07","_JobHead_Calc_COOValuePerc08","_JobHead_Calc_COOValuePerc09","_JobHead_Calc_COOValuePerc10","_JobHead_Calc_COOValuePerc11","_JobHead_Calc_COOValuePerc12","_JobHead_Calc_COOValuePerc13","_JobHead_Calc_COOValuePerc14","_JobHead_Calc_COOValuePerc15","_JobHead_Calc_CountryDesc01","_JobHead_Calc_CountryDesc02","_JobHead_Calc_CountryDesc03","_JobHead_Calc_CountryDesc04","_JobHead_Calc_CountryDesc05","_JobHead_Calc_CountryDesc06","_JobHead_Calc_CountryDesc07","_JobHead_Calc_CountryDesc08","_JobHead_Calc_CountryDesc09","_JobHead_Calc_CountryDesc10","_JobHead_Calc_CountryDesc11","_JobHead_Calc_CountryDesc12","_JobHead_Calc_CountryDesc13","_JobHead_Calc_CountryDesc14","_JobHead_Calc_CountryDesc15","_JobHead_Calc_CountryISOCode01","_JobHead_Calc_CountryISOCode02","_JobHead_Calc_CountryISOCode03","_JobHead_Calc_CountryISOCode04","_JobHead_Calc_CountryISOCode05","_JobHead_Calc_CountryISOCode06","_JobHead_Calc_CountryISOCode07","_JobHead_Calc_CountryISOCode08","_JobHead_Calc_CountryISOCode09","_JobHead_Calc_CountryISOCode10","_JobHead_Calc_CountryISOCode11","_JobHead_Calc_CountryISOCode12","_JobHead_Calc_CountryISOCode13","_JobHead_Calc_CountryISOCode14","_JobHead_Calc_CountryISOCode15","_Part_RptLanguageID","_Part_Company","_Part_PartDescription","_Part_PartNum","_Part_EOL_Expiry_Days_c","_Part_EOL_Expiry_Imminent_Days_c","_Part_EOL_Formula_Amount_Title_c","_Part_EOL_Formula_Description_Tiitle_c","_Part_EOL_Forumula_Amount_01_c","_Part_EOL_Forumula_Amount_02_c","_Part_EOL_Forumula_Amount_03_c","_Part_EOL_Forumula_Amount_04_c","_Part_EOL_Forumula_Amount_05_c","_Part_EOL_Forumula_Amount_06_c","_Part_EOL_Forumula_Amount_07_c","_Part_EOL_Forumula_Amount_08_c","_Part_EOL_Forumula_Amount_09_c","_Part_EOL_Forumula_Amount_10_c","_Part_EOL_Forumula_Amount_11_c","_Part_EOL_Forumula_Amount_12_c","_Part_EOL_Forumula_Amount_13_c","_Part_EOL_Forumula_Description_01_c","_Part_EOL_Forumula_Description_02_c","_Part_EOL_Forumula_Description_03_c","_Part_EOL_Forumula_Description_04_c","_Part_EOL_Forumula_Description_05_c","_Part_EOL_Forumula_Description_06_c","_Part_EOL_Forumula_Description_07_c","_Part_EOL_Forumula_Description_08_c","_Part_EOL_Forumula_Description_09_c","_Part_EOL_Forumula_Description_10_c","_Part_EOL_Forumula_Description_11_c","_Part_EOL_Forumula_Description_12_c","_Part_EOL_Forumula_Description_13_c","_Part_EOL_Hazard_Information_c","_Part_EOL_Parent_Part_c","_Part_EOL_pH_Range_c","_Part_EOL_Preparation_Instructions_c","_Part_EOL_Storage_Temp_Max_c","_Part_EOL_Storage_Temp_Min_c","_Part_SysRowID"

“eng”,“EOLABS”,"",“00003344”,“LS0012-V001-500”,“0”,"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",“eng”,“EOLABS”,“Bacitracin (500ml)”,“Part Num xxxx “,“0”,“0”,“g/L”,“Formulation”,””,"","","","","","","","","","","","",“test line 1”,“test line 2”,"","","","","","","","","","","","","","","","","",“9d6d1de4-9641-4f94-e811-fffd33b475a8”

If above repeated with Auto Print having Constant and 4
image

%BTW% /AF="[\BARTENDER\Labels\EpicorTest\XXXX.BTW](file://bartender/Labels/EpicorTest/XXXX.BTW)" /D="" /PRN="[\BARTENDER\EpicorTest](file://bartender/XXXX)" /DBTEXTHEADER=3 /R=3 /P

%END%

“_JobHead_RptLanguageID”,"_JobHead_Company","_JobHead_ContractID","_JobHead_JobNum","_JobHead_PartNum","_JobHead_QtyCompleted","_JobHead_EOL_ExpiryDate_c","_JobHead_Calc_COOQtyPerc01","_JobHead_Calc_COOQtyPerc02","_JobHead_Calc_COOQtyPerc03","_JobHead_Calc_COOQtyPerc04","_JobHead_Calc_COOQtyPerc05","_JobHead_Calc_COOQtyPerc06","_JobHead_Calc_COOQtyPerc07","_JobHead_Calc_COOQtyPerc08","_JobHead_Calc_COOQtyPerc09","_JobHead_Calc_COOQtyPerc10","_JobHead_Calc_COOQtyPerc11","_JobHead_Calc_COOQtyPerc12","_JobHead_Calc_COOQtyPerc13","_JobHead_Calc_COOQtyPerc14","_JobHead_Calc_COOQtyPerc15","_JobHead_Calc_COOValuePerc01","_JobHead_Calc_COOValuePerc02","_JobHead_Calc_COOValuePerc03","_JobHead_Calc_COOValuePerc04","_JobHead_Calc_COOValuePerc05","_JobHead_Calc_COOValuePerc06","_JobHead_Calc_COOValuePerc07","_JobHead_Calc_COOValuePerc08","_JobHead_Calc_COOValuePerc09","_JobHead_Calc_COOValuePerc10","_JobHead_Calc_COOValuePerc11","_JobHead_Calc_COOValuePerc12","_JobHead_Calc_COOValuePerc13","_JobHead_Calc_COOValuePerc14","_JobHead_Calc_COOValuePerc15","_JobHead_Calc_CountryDesc01","_JobHead_Calc_CountryDesc02","_JobHead_Calc_CountryDesc03","_JobHead_Calc_CountryDesc04","_JobHead_Calc_CountryDesc05","_JobHead_Calc_CountryDesc06","_JobHead_Calc_CountryDesc07","_JobHead_Calc_CountryDesc08","_JobHead_Calc_CountryDesc09","_JobHead_Calc_CountryDesc10","_JobHead_Calc_CountryDesc11","_JobHead_Calc_CountryDesc12","_JobHead_Calc_CountryDesc13","_JobHead_Calc_CountryDesc14","_JobHead_Calc_CountryDesc15","_JobHead_Calc_CountryISOCode01","_JobHead_Calc_CountryISOCode02","_JobHead_Calc_CountryISOCode03","_JobHead_Calc_CountryISOCode04","_JobHead_Calc_CountryISOCode05","_JobHead_Calc_CountryISOCode06","_JobHead_Calc_CountryISOCode07","_JobHead_Calc_CountryISOCode08","_JobHead_Calc_CountryISOCode09","_JobHead_Calc_CountryISOCode10","_JobHead_Calc_CountryISOCode11","_JobHead_Calc_CountryISOCode12","_JobHead_Calc_CountryISOCode13","_JobHead_Calc_CountryISOCode14","_JobHead_Calc_CountryISOCode15","_Part_RptLanguageID","_Part_Company","_Part_PartDescription","_Part_PartNum","_Part_EOL_Expiry_Days_c","_Part_EOL_Expiry_Imminent_Days_c","_Part_EOL_Formula_Amount_Title_c","_Part_EOL_Formula_Description_Tiitle_c","_Part_EOL_Forumula_Amount_01_c","_Part_EOL_Forumula_Amount_02_c","_Part_EOL_Forumula_Amount_03_c","_Part_EOL_Forumula_Amount_04_c","_Part_EOL_Forumula_Amount_05_c","_Part_EOL_Forumula_Amount_06_c","_Part_EOL_Forumula_Amount_07_c","_Part_EOL_Forumula_Amount_08_c","_Part_EOL_Forumula_Amount_09_c","_Part_EOL_Forumula_Amount_10_c","_Part_EOL_Forumula_Amount_11_c","_Part_EOL_Forumula_Amount_12_c","_Part_EOL_Forumula_Amount_13_c","_Part_EOL_Forumula_Description_01_c","_Part_EOL_Forumula_Description_02_c","_Part_EOL_Forumula_Description_03_c","_Part_EOL_Forumula_Description_04_c","_Part_EOL_Forumula_Description_05_c","_Part_EOL_Forumula_Description_06_c","_Part_EOL_Forumula_Description_07_c","_Part_EOL_Forumula_Description_08_c","_Part_EOL_Forumula_Description_09_c","_Part_EOL_Forumula_Description_10_c","_Part_EOL_Forumula_Description_11_c","_Part_EOL_Forumula_Description_12_c","_Part_EOL_Forumula_Description_13_c","_Part_EOL_Hazard_Information_c","_Part_EOL_Parent_Part_c","_Part_EOL_pH_Range_c","_Part_EOL_Preparation_Instructions_c","_Part_EOL_Storage_Temp_Max_c","_Part_EOL_Storage_Temp_Min_c","_Part_SysRowID"

“eng”,“EOLABS”,"",“00003344”,“LS0012-V001-500”,“0”,"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",“eng”,“EOLABS”,“Bacitracin (500ml)”,“LS0012-V001-500”,“0”,“0”,“g/L”,“Formulation”,"","","","","","","","","","","","","",“test line 1”,“test line 2”,"","","","","","","","","","","","","","","","","",“9d6d1de4-9641-4f94-e811-fffd33b475a8”

“eng”,“EOLABS”,"",“00003344”,“LS0012-V001-500”,“0”,"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",“eng”,“EOLABS”,“Bacitracin (500ml)”,“LS0012-V001-500”,“0”,“0”,“g/L”,“Formulation”,"","","","","","","","","","","","","",“test line 1”,“test line 2”,"","","","","","","","","","","","","","","","","",“9d6d1de4-9641-4f94-e811-fffd33b475a8”

“eng”,“EOLABS”,"",“00003344”,“LS0012-V001-500”,“0”,"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",“eng”,“EOLABS”,“Bacitracin (500ml)”,“LS0012-V001-500”,“0”,“0”,“g/L”,“Formulation”,"","","","","","","","","","","","","",“test line 1”,“test line 2”,"","","","","","","","","","","","","","","","","",“9d6d1de4-9641-4f94-e811-fffd33b475a8”

“eng”,“EOLABS”,"",“00003344”,“LS0012-V001-500”,“0”,"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",“eng”,“EOLABS”,“Bacitracin (500ml)”,“LS0012-V001-500”,“0”,“0”,“g/L”,“Formulation”,"","","","","","","","","","","","","",“test line 1”,“test line 2”,"","","","","","","","","","","","","","","","","",“9d6d1de4-9641-4f94-e811-fffd33b475a8”

My personal experience with Bartender and EDI, its better to write c# code to create a file with required data which is future proof.

1 Like

Thanks Arul for the reply, this may be the route I have to go down. Any sample code of something similar (obfuscated sensitive parts) would greatly help me along. I have the coding skills, just looking for pointers to get the job done quicker.

Sample code.

string lFileName = Session.CompanyID + "_" + DateTime.Now.ToString("yyyyMMdd") + DateTime.Now.ToString("HHmmss") + ".csv";
string lColHead = "Company,GroupID,VendorID,InvoiceNum,InvoiceDate" ;
string lPath = string.Empty;

using (var MyFile = new System.IO.StreamWriter(new System.IO.FileStream(lPath + lFileName, System.IO.FileMode.Create)))
{
        MyFile.WriteLine(@lColHead);
	foreach (var UD05_iterator in (from UD05_Row in Db.UD05.With(LockHint.NoLock)
                                               where string.Compare(UD05_Row.Company, Session.CompanyID, true) == 0 &&
                                                UD05_Row.CheckBox02 == false select UD05_Row))
        {
                 var UD05Row = UD05_iterator ;
		 MyFile.WriteLine(@UD05Row.Company + "," + "lGroupName" + "," + UD05Row.Key1 + "," + "lInvoiceNum" + "," + "lInvoiceDate") ;	
	}		
}

Many thanks