Have a parts table where each part contains 4 lines.
In one of the line I have a serial number.
The serial numbers are just a long text line from datamapper, where each line is split by a @
Each serial number needs to be on a single line under the part.
Is there a way to get the idividual part line to break into a new page.
In my case the serials just keep comming down the page. Through the bottom note an header on the next page. It keeps the record together.
Script for splitting the long text line into serials.:
var InvStatus = this.record.fields[‘InvStatus’];
//var InvStatus = ‘Batch number : 19-08-30967@Batch number : 19-11-31350@’;
var Text1 = ‘’, SerBatNo = ‘’, Text2 = ‘’;
var CurrentLine = ‘’;
var LineCount = 0;
// Count number of lines - line ends with @
for (var i = 0; i < InvStatus.length; i++) {
if(InvStatus.charAt(i) == ‘@’)
LineCount++;
}
// Split lines into single lines
for (var i = 0; i < LineCount; i++){
CurrentLine = InvStatus.split(‘@’)[i];
// Check for batch + serial number
if (CurrentLine.indexOf("Batch") != -1) Text1 = '<b class="DarkBlue"><b>Batch No.: </b>';
else if (CurrentLine.indexOf("Serial") != -1 )Text1 = '<b class="DarkBlue"><b>Serial No.: </b>';
else Text1 = '';
Text2 = CurrentLine.split(':')[CurrentLine.split(":").length-1];
Text2 = Text2.trim();
SerBatNo += Text1 + '<b class="BlackNormal">' + Text2 + '<br/>';
If you do the splitting in the Datamapper and end-up with the serials in a detail table, then the overflowing will be handled by Connect inner ability to do it.
the way you ar doing it right now is adding a lot of lines inside a single cell which causes the overflowing mechanism to not know what to do with that specific cell.
In a detail table, each serial would have its own row.
It works when the text is in a detalid table in a seperate table row.
But it gives me another chalange
Before I had a description field and the serial at the same line…
I sit posible to have that when they are not in the same data-repeat ?
There is always only one description, but there can be multiple serials.
Could you share a anonymized version of your Template and Datamapper? There is something I would like to try. Or you can send me the package vis a personnal message.
I suggest to add a class to the table data element holding the serial and create a script to iterate over these using the “Each matched element”-scope in the script options. In the script you can fetch some information from the parent element (the row), this includes information on the detail table data used for this row (stored in the data-group-reference attribute). Use this info to determine the record index.