Perfect thanks Rod! I forgot about those if params!
I was hoping the Post Pagination script would allow me to do what I wanted in designer, but it doesnt seem the case as it doesnt calculate the Page pagination accross records from what I can see, here is what I have so far but it isnt working as the page numbers are incorrect:
var page = results;
var barcode = "";
var sequenceArray = ["","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
var formSeq = 0;
function divide (number){
if(number > 26){
var newnumber = number - 26;
return divide(newnumber);
}else{
return number ;
}
}
results.each(function(index) {
formSeq++;
// #1 Grouping
if(this.info().sheetNo == this.info().sheetCount)
{
barcode += "B";
} else{
barcode +="A";
}
// #2-3 Selective Feed
var station1 = [["A"],["B","",["D","","",["H","","","","P"],"L"],["F","","","","N"],"J"],["C","","",["G","","","","O"],"K"],["E","","","","M"],["I"]];
var station2 = ["A","","","","","B"];
for(insert in inserts)
{
if (insert == countryCode){
barcode += station1[inserts[insert][0]["feedstation"]][0];
}
}
barcode += station2[5];
// #4 Form Sequence within Job (A>>>Z) - Every Page in job sheetNo + kseq -1
// barcode += sequenceArray[divide((this.info().sheetNo + json_data.kseq) - 1)];
barcode += ":"+index+":";
// #5 Form Sequence within Group (A>>>Z) - Sheets No in Record
barcode += sequenceArray[divide(this.info().sheetNo)];
// #6 Group Sequence (A>>>Z) - Kseq
barcode += sequenceArray[divide((json_data.kseq))];
// #7 Divert/Jog (A=No Divert or Jog, K=Ink Mark / VS Jog or U= InkMark and No Seal)
barcode += "A";
// #8-17 JobID (10 Digits)
var jobID = "0000000000"+json_data.kbatch;
barcode += jobID.substr(jobID.length-10, 10);
// #18-27 Mail Piece ID (10 Digits)
var id = "0000000000"+record.fields.id;
barcode += id.substr(id.length-10, 10);
});
results.html(barcode);