I’m working on an app that has to do with printing label sheets for Lock Out Tag Out.
In this app, we will be managing different lockout points on equipment. For example, a piece of equipment might have 3 locations to lockout or it may have 100 locations to lockout.
Each lockout point will have a label printed for it, with specific metadata associated with it.
The label sheets we have can print up to 3 labels per sheet. So in the example, the equipment with 3 lockout locations will only need 1 label sheet printed, but the lockout location with 100 locations will need 34 label sheets printed.
I have a table with all the metadata for each lockout location and a variable that calculates the number of sheets needed for the piece of equipment. I also have a label sheet template for printing.
In the app so far, I have a connector function that grabs the record IDs of the lockout locations for a selected equipment and stores those IDs in an array. I’ve made 3 record placeholders for printing on the label sheet template called label 1, label 2, and label 3. When printing, the array is divided by 3’s and the first record ID in the series will be loaded into label 1 record placeholder, the second ID will be loaded into label 2 record placeholder, and the third into the label 3.
Bad Solution 1
Right now, a user can input the sheet number that they want to print in order to print a single label sheet with the corresponding fields associated with the lockout points. It shifts the indexes from the array to assign to label 1, label 2, and label 3 depending on the sheet they select to print. This idea works fine for equipment with a low number of lockout points, but as the number of lockout points increases, this method isn’t very efficient.
Bad Solution 2
I had suggested to the team I’m developing the app for, to provide me with a maximum number of lockout points so then I could build more template label pages with more record placeholders, label 4, label 5, label 6, etc then I could build step groups for printing 1 label sheet, 2 label sheets, 3 label sheets, etc up to the max and use the variable calculating the number of sheets to print the right step group. This would require a lot of work and would have either a lot of triggers or a lot of if/else statements.
Ideally, what I need is to be able to loop through printing a step and popping off those record ID’s from my array until my array length is 0. I’d need to do this with only one initial print dialog or the user would need to press print each time they print a sheet in which case, it’s no better than “Bad Solution 1”.
Do you have any insight that could help me with this? Have you seen anyone use a connector to perform some kind of action like this?